1

I am building a gift certificate item and am using gift voucher options as modifiers.

It all works great. However, I need to output those modifier values into a template in a particular design – as such, I want to get values of particular modifiers.

For example, I have a modifier, system called this ‘modifiers_6’ - I can only get its value when I use the modifiers loop – but I also get all other modifiers.

Was hoping is could be like {modifiers_6:modifier_value} - I wrapped the modifiers and items loop tags around this but no luck.

Any ideas? How do I target specific modifiers without using the whole loop?

2

You should be able to run a conditional check on the modifier names along the lines of:

{modifier_options}

// Only output a particular modifier by name
{if option_name == 'my_name'} 
    {option_name} {if price_mod_val} ({price_mod}) {/if}
{/if}

{/modifier_options}

Then you limit the output to a particular modifier. You still need to wrap it in the {modifier_options} loop but you can just wrap the whole section in this if you need to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.