如何在product-variants.tpl中分离变体?

时间:2019-05-28 22:48:51

标签: product prestashop-1.7 variant

我正在尝试分离product-variants.tpl的变体 我需要进行此拆分(并且必须将它们添加到product-special.tpl:

TAB 1

颜色:所有颜色

TAB 2

颜色2:所有第二种颜色

TAB 3

选项1:A B

TAB 4

选项2:C D

我正在按ID呼叫该组,但是我仍然看到其他组。

{foreach from=$groups key=id_attribute_group item=group}
{if !empty($group.attributes)}
<div class="clearfix product-variants-item">
  <span class="control-label">{$group.name}</span>
  {if $group.group_type == 'select'}
    <select
      class="form-control form-control-select"
      id="group_{$id_attribute_group}"
      data-product-attribute="{$id_attribute_group}"
      name="group[{$id_attribute_group}]">
      {foreach from=$group.attributes key=id_attribute item=group_attribute}
        <option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selected} selected="selected"{/if}>{$group_attribute.name}</option>
      {/foreach}
    </select>
  {elseif $group.group_type == 'color'}
    <ul id="group_1">
      {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="group_1" name="group[1]" 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>
        </li>
      {/foreach}
    </ul>

当我进行其他更改时,我会出现空白页。

0 个答案:

没有答案