jsqu99 / spree_flexi_variants

Spree extension to create product variants as-needed
BSD 3-Clause "New" or "Revised" License
116 stars 143 forks source link

How to apply ad hoc option types to customization types? #69

Closed zib-in closed 10 years ago

zib-in commented 11 years ago

Assume that we have a customizable product which people can write custom texts on it, like this;

+-------------+------------------------------+--------------------------------+----------+
|    TEXT     |           FontType           |           FontColour           | FontSize |
+-------------+------------------------------+--------------------------------+----------+
| text_input1 | Spree::OptionType #fonttype1 | Spree::OptionType #fontcolour1 | ...      |
| text_input2 | Spree::OptionType #fonttype1 | Spree::OptionType #fontcolour2 | ...      |
| text_input3 | Spree::OptionType #fonttype1 | Spree::OptionType #fontcolour1 | ...      |
+-------------+------------------------------+--------------------------------+----------+

How can I do something like this design with using flexi_variant? Can I create new customization types calculators that include ad hoc options?

jsqu99 commented 11 years ago

i would say create the customization just w/ the text, but in it's calculator reference the ad hoc options you have configured for the product. I've done this before in the calculators. you should be able to reference what you need from the args provided to 'compute'