我在商店的每个产品中添加了组合。这种组合是'包装'并有2个属性:100个单位框和200个单位框。每个属性都有一个参考编号。
在产品页面中,显示了一个' select'使用这2个属性,以及右侧的文本'选择'使用参考编号进行更新(如果选择100个单位框,文本将使用此属性的参考编号进行更新,如果选择200个单位框,参考编号将更新为其他参考编号,但绝不可以看到两个参考编号)同样的。)
我想要的是显示这些属性和引用的列表而不是选择'我需要同时显示属性和引用。
现在,这是我的代码(在product.tpl中):
<select style="float: left; margin-right: 15px; height: 23px; padding:0px; padding-bottom: 0px;" name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option>
{/foreach}supplier_reference
</select>
{if isset($FIELD_productShowReference) && $FIELD_productShowReference || !isset($FIELD_productShowReference)}
<p style="padding-top: 3px;" id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}>
<label class="texto-referencia" style="float: left; font-size: 15px; margin-right: -5px;">{l s='Ref:'}</label>
<span class="editable num-referencia" itemprop="sku" style="font-size: 15px;">{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span>
</p>
{/if}
答案 0 :(得分:0)
尝试:
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<input type="radio" name="{$groupName}" value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} checked="checked"{/if}
{/foreach}
{if isset($FIELD_productShowReference) && $FIELD_productShowReference || !isset($FIELD_productShowReference)}
<p style="padding-top: 3px;" id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}>
<label class="texto-referencia" style="float: left; font-size: 15px; margin-right: -5px;">{l s='Ref:'}</label>
<span class="editable num-referencia" itemprop="sku" style="font-size: 15px;">{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span>
</p>
{/if}