Coder Social home page Coder Social logo

uc_views_attribute_fork's People

Contributors

mattbk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

manimans

uc_views_attribute_fork's Issues

Create named fields for all attributes

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.

Do other fields generated by uc_views_attribute still work?

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 price
  • uc_views_attribute_handler_filter_attr.inc

Pull attribute names from the database and match to keys

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):

  • Determine how named attributes (not attribute values) are stored in the database
  • Create an array of attributes by display name, from the database.
  • Unserialize the attribute values stored on the product/order/whatever we're already looking at
  • Create a Views Field for each named attribute in the database
  • Match the attribute values to the Views fields based on name
  • Display

Attribute handlers

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];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.