Forum
Product Option Detection?
Is there a correct way to detect the product options in perch templates?
When looping through the options I want to detect an option group and render it out using a select field rather than radio buttons. Is something like the following possible?
<perch:if productopt id="t-shirt-size" match="eq" value="t-shirt-size">
</perch:if>
Thanks,
Dan
What's the context?
This is certainly not valid syntax:
The documentation indicated there is a way of controlling the output of the options for a product, like below. It cycles through each set of options and creates radio buttons. I'm trying to apply radio buttons to one set of options and a drop down select for another set of options. Is there a way to detect within the below loop which options is being outputted so that I can then apply different html.
If you use
<perch:showall />
you can see all the IDs available in the template at that point that you can test for withperch:if
.Thanks Drew!
Full solution below if anyone needs it: