ecommerce customer choice sets

Permalink
Hello, I would like to create sets of customer choices so I can group them and display them on a product based on a set of customer choices. I realize I have to code this myself but wondering if anybody has some insight to save me time on doing something like this.

Note I am aware of global choices and defaults for a product page but I need another level of grouping and control for choices.

zanedev
 
zanedev replied on at Permalink Reply
zanedev
It appears that customer choices are just fancy product attributes so it seems like I could associate it with a set like any other product attribute.
zanedev replied on at Permalink Reply
zanedev
Ah I see under settings in the dashboard there are product option attribute sets. That allows you to group the product options (customer choices) under a single set. Only thing is I need to assign them to multiple sets so I can share some options across products but not all in a set. I'm going to look into associating product option attributes to product sets.
zanedev replied on at Permalink Reply
zanedev
This actually worked out pretty good, I was able to associate and display multiple customer choices with a product set. I had to hack the core_commerce attributes but basically I created a new table for associating product sets with product options like
<table name="CoreCommerceProductSetProductOptions">
    <field name="prsppoID" type="I" size="10">
      <KEY/>
      <AUTOINCREMENT/>
      <UNSIGNED/>
    </field>
    <field name="prsID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="akID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>


Then when saving and displaying product options I can associate or pull by product set meaning I can show a default set of product attributes based on the product set rather than having to set them manually with each product. Hacky but works for now and doesn't seem to affect the product custom choices. I modified the core_commerce_product_option attribute category to take into account the associated sets as they are saved as global customer choices.

To make this a sitewide change I had to modify the product model get attributes to check for this and also the checks in order and product display blocks.

But now I'm in a death spiral of other complicated attribute requirements that aren't supported, some simple like default selection for select attributes, others related to more complex pricing modifications based on attribute combinations.