Jump to content

If id_attribute_group is then do this...problem


giulym

Recommended Posts

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

  • 4 weeks later...
  • 8 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...