I'm creating a store using snipcart. I would like to create a set of options which gives the user the option to choose which materials a product can be sold in, this will be a predetermined list set up as a checkboxes fieldset.
In this situation we'll say the options are bronze, silver and gold.
I output an array of these in the snipcart code which requires each option to be seperated by a pipe.
data-item-custom1-options="{{ available_materials|piped }}"
which outputs
data-item-custom1-options="bronze|silver|gold"
This is where things get tricky though, I also want the user to be able to modify price based on material.
This would be the typical approach without variables:
data-item-custom6-options="Small|Medium[+5.00]|Large[+10.00]|Kid[-5.00]"
I would essentially need to do something like this:
data-item-custom1-options="{{ available_materials|piped|ensure_right="[{ new_price }]" }}"
except piped
only seems to work with this syntax {{ available_materials|piped }}
while ensure right only works like this {{ available_materials }}{{ value ensure_right="[+100]" }}{{ available_materials }}
And secondly, will it be possible to create a variable for the price difference that functions inside {{ available_materials }}
?
Anyway thoughts would be appreciated!