Php Prestashop:如何在属性大小之后添加自己的行?

Php Prestashop:如何在属性大小之后添加自己的行?,php,html,smarty,prestashop,prestashop-1.6,Php,Html,Smarty,Prestashop,Prestashop 1.6,我需要在我的产品页面(在prestashop中)的属性之间添加我自己的行。在我的例子中,在“大小”之后是一个属性\u标签,在该属性之后分组\u 5“大小”->,添加类似这样的内容:“在我们的指南中找到您的大小。” 要添加此代码,请执行以下操作: <p class="find">Find your size in our guide <a href="htttp://bijutaniki.com/#">here</a></p> 在我们的指南中找到您

我需要在我的产品页面(在prestashop中)的属性之间添加我自己的行。在我的例子中,在“大小”之后是一个属性\u标签,在该属性之后分组\u 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}

{if isset($groups)}
{foreach from=$groups key=id\u attribute\u group item=group}
{if$group.attributes |@count}
{$group.name | escape:'htmlall':'UTF-8'}:
{assign var=“groupName”value=“group\u$id\u attribute\u group”}
{if($group.group_type=='select')}
{foreach from=$group.attributes key=id\u attribute item=group\u attribute}
{$group_属性|转义:'htmlall':'UTF-8'}
{/foreach}
{elseif($group.group_type=='color')}
    {assign var=“default_colorpicker”value=”“} {foreach from=$group.attributes key=id\u attribute item=group\u attribute} {如果文件_存在($col_img_dir | cat:$id_attribute | cat:'.jpg'))
    {/if} {if($group.default=$id\u属性)} {$default\u colorpicker=$id\u attribute} {/if} {/foreach}
{elseif($group.group_type=='radio')}
    {foreach from=$group.attributes key=id\u attribute item=group\u attribute}
  • {$group_属性|转义:'htmlall':'UTF-8'}
  • {/foreach}
{/if} {/if} {/foreach} {/if}
您可以使用($group.name=='Size'}条件。将其添加到
group.type==select
conditional下

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

在我们的指南中找到您的尺码

{/if}

更改属性的“大小”你有另一个名称。

你的问题是什么?你知道把它放在哪里,你知道把它放在那里。.如果你想把它放在控制台的地方,那么几乎在底部,就在
下面就是你要放它的地方。不。如果我把它放在那里,每个属性后面都会显示新的代码。我可以在这里看到它:我只想在大小之后显示此代码(保加利亚语中的)。然后在
{if}
语句之间尝试
{if($group.group_type=='select')}
。不过,这将适用于所有下拉属性。因此,如果您有更多,您需要创建另一个if,以检查
大小
我在某些产品上有更多的下拉属性。因此,我需要为组5(在我的情况下为大小)添加其他“if”。添加它的正确方式是什么?请原谅我的这个愚蠢问题?