групповой аттрибут prestashop 1.7.6.4 - PullRequest
0 голосов
/ 21 апреля 2020

У меня проблема с кодом, который я приведу ниже в PrestaShop. У меня есть 2 атрибута color + size. Я хочу деактивировать цвета, когда нет размера и цвета, то есть цветовые вкладки больше не нужны. кликабелен.

        {if $group.group_type == 'color'}
          <ul id="group_{$id_attribute_group}" class="variant-links list-inline">
            {foreach from=$group.attributes key=id_attribute item=group_attribute}

            {if ( $group.attributes_quantity[{$id_attribute|intval}] == '0' )}
                {$notshow = "desactive"}
            {else}
                {$notshow = ""}
            {/if} 

              <li class="list-inline-item d-inline-block">
                <div class="custom-control custom-checkbox">
                  <label class="{$notshow} {if $group.name == 'Taille' } custom-control-label-taille {else} custom-control-label {/if}{if $group_attribute.selected} active{/if}" 
                        {if $group_attribute.html_color_code}style="background-color: {$group_attribute.html_color_code}"{/if}
                        {if $group_attribute.texture}style="background-image: url({$group_attribute.texture})"{/if}
                  >
                    <input  class="custom-control-input 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 class="{if $group.name == 'Taille' } sr-only-taille {else} sr-only {/if}">{$group_attribute.name}</span>
                  </label>
                </div>
              </li>
            {/foreach}
          </ul>
        {/if}
...