0

我需要在我的产品页面(在 prestashop 中)的属性之间添加我自己的行。在我的例子中,在“大小”之后是一个属性标签,group_5“大小”-> 在该属性之后添加类似:“在我们的指南中查找您的大小”。

要添加此代码:

<p class="find">Find your size in our guide <a href="htttp://bijutaniki.com/#">here</a></p>

最终外观需要像:

在此处输入图像描述

在 product.tpl 中看起来像:

            <div class="product_attributes">
            {if isset($groups)}
            <!-- attributes -->
            <div id="attributes">
            <div class="clear"></div>
            {foreach from=$groups key=id_attribute_group item=group}
                {if $group.attributes|@count}
                    <fieldset class="attribute_fieldset">
                        <label class="attribute_label" for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :&nbsp;</label>
                        {assign var="groupName" value="group_$id_attribute_group"}
                        <div class="attribute_list">
                        {if ($group.group_type == 'select')}
                            <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();">
                                {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:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option>
                                {/foreach}
                            </select>
                        {elseif ($group.group_type == 'color')}
                            <ul id="color_to_pick_list" class="clearfix">
                                {assign var="default_colorpicker" value=""}
                                {foreach from=$group.attributes key=id_attribute item=group_attribute}
                                <li{if $group.default == $id_attribute} class="selected"{/if}>
                                    <a id="color_{$id_attribute|intval}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value};" title="{$colors.$id_attribute.name}" onclick="colorPickerClick(this);getProductAttribute();">
                                        {if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
                                            <img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$colors.$id_attribute.name}" width="20" height="20" /><br />
                                        {/if}
                                    </a>
                                </li>
                                {if ($group.default == $id_attribute)}
                                    {$default_colorpicker = $id_attribute}
                                {/if}
                                {/foreach}
                            </ul>
                            <input type="hidden" class="color_pick_hidden" name="{$groupName}" value="{$default_colorpicker}" />
                        {elseif ($group.group_type == 'radio')}
                            <ul>
                                {foreach from=$group.attributes key=id_attribute item=group_attribute}
                                    <li>
                                        <input type="radio" class="attribute_radio" name="{$groupName}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} onclick="findCombination();getProductAttribute();" />
                                        <span>{$group_attribute|escape:'htmlall':'UTF-8'}</span>
                                    </li>
                                {/foreach}
                            </ul>
                        {/if}
                        </div>
                    </fieldset>
                {/if}
            {/foreach}
            </div>
        {/if}
4

1 回答 1

0

您可以使用 ($group.name == 'Size'} 有条件的。在group.type == select有条件的情况下添加它。

{if ($group.name == 'Size')}
 <p class="find">Find your size in our guide <a href="htttp://bijutaniki.com/#">here</a></p>
{/if}

更改“大小”属性,您有另一个名称。

于 2014-08-30T09:15:22.107 回答