mattbk / uc_views_attribute_fork Goto Github PK
View Code? Open in Web Editor NEWFork of the Drupal module uc_views_attribute for displaying attributes in Views.
Fork of the Drupal module uc_views_attribute for displaying attributes in Views.
Not compatible with D7, don't need to upgrade it (in Ubercart core).
When click sorting is added to a field in a table, it doesn't sort right.
Not compatible with D7, don't need to convert.
For example, if you have two products with these attributes:
A Shirt
B Shirt
and show them in the same table, values for both "Size" and "Cut" will be in the same column.
Thanks for this effort, I may have a chance to test it on a D6 to D7 upgrade shortly. I noticed one really minor issue (realizing these handlers are likely temporary until a better way to deal with them is worked out). The 'field_order_product_attribute07' handler is identical to the one for attribute06:
//Grab the value for the sixth attribute.
$result = $rows[5];
Should instead be:
//Grab the value for the seventh attribute.
$result = $rows[6];
This is the kicker for making this module much more useful. How to create a Views field for each attribute?
Can multiple handlers be added in the same handler file? If so, it could be possible to loop through the attributes array in uc_views_attribute.views.inc
to create the view handler names, then loop through the attributes array in uc_views_attribute_handler_WHATEVER.inc
to create the actual handlers. If all the handlers can be the same format (text, numeric, etc.) this could work.
There are two big ifs to look into above.
In uc_views_attribute.views.inc
these views handlers are also defined:
Model
, uses views_handler_relationship
Stock
, uses views_handler_relationship
uc_views_attribute_handler_field_combination.inc
uc_views_attribute_handler_field_combination_price.inc
, cost and sell priceuc_views_attribute_handler_filter_attr.inc
https://trello.com/c/aBScCzzm/132-attributes
Take the names of the attributes from a table in the database. Then you join those on to the named array based on the attribute field unserialized in the View.
Translation (that was a voice memo):
Not compatible with D7, don't need to upgrade it (in Ubercart core).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.