giulym Posted August 28, 2019 Share Posted August 28, 2019 How can I call the attribute group of the $group.group_type color? I need to have the colors that are in group[{$id_attribute_group}] for e.g. group_1, in the right column of product page. I want to do something like: {if $group.group_type == 'color' && id_attribute_group == '1'} then do this... but it doesn't work, it calls only the first color of the group (but the id is correct!). I have to do the same for radio {if $group.group_type == 'radio' && id_attribute_group == '2'} then do this... {elseif $group.group_type == 'color'} <ul id="group_{$id_attribute_group}"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <li class="float-xs-left input-container"> <label> <input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}> <span {if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if} {if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if} ><span class="sr-only">{$group_attribute.name}</span></span> </label> <div class="colors-names">{$colors.$id_attribute.name}</div> </li> {/foreach} Thanks if you can help me! Link to comment Share on other sites More sharing options...
Rolige Posted August 29, 2019 Share Posted August 29, 2019 You need to add a $ before id_attribute_group variable. Link to comment Share on other sites More sharing options...
giulym Posted September 22, 2019 Author Share Posted September 22, 2019 the "&&" doesn't work...is red signed 🤔 Link to comment Share on other sites More sharing options...
hshaker Posted May 29, 2020 Share Posted May 29, 2020 (edited) {if $group.group_type == 'color' && $id_attribute_group == '4'} your content...... {/if} Tested -- PS 1.7.5 Edited May 29, 2020 by hshaker (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now