Add/associate content to product options in Ubercart

440 views Asked by At

We want to add a feature into an existing store to add nutrition facts for each product. Each option of a product (in this case, flavor) has different nutrition information, so each one needs to have content associated to it where we can add the facts in.

Does anyone know if this has been accomplished in a module yet? What is the best way then, to go about this?

The end result would be if you were picking different flavors on a product, the fact content is updated along a sidebar with AJAX- but I am not sure how that content is hooked into the options just yet.

1

There are 1 answers

2
Jason Smith On BEST ANSWER

It might be simpler to use a separate table (or content type) to contain the nutritional information and use an AJAX callback to pull it in based on SKU.

The module to do handle this functionality would:

  • define the schema for the new table and install it on enable (hook_schema, hook_install)
  • include some jquery to listen to change on the flavor attribute box and ajax load the nutritional content. (hook_menu for the callback, hook_init to add the js)
  • Each of your attributes can have a distinct SKU so you can use that to key the data table