【发布时间】:2013-08-16 13:14:35
【问题描述】:
我想修改产品属性在我的产品页面上的显示方式。
默认情况下,属性以 html 标记显示。 我想用 html 表单显示这些属性并为我的属性添加描述。
到目前为止,我尝试的是修改 product.tpl 文件,并进行了以下更改:
<select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
{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>
进入
<form name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<input type="radio" name="test" value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} checked="checked"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}
{/foreach} </form>
通过此修改,属性似乎不再与产品相关联,因为始终显示以下消息:“以下产品不适用于此属性...”。所以它不起作用,因为我不能再将产品添加到购物车并且属性不再影响价格......
您对使它正常工作的方法有任何线索吗? 您知道哪些文件与产品属性相关联吗? 是否需要修改 AdminAttributes.php 文件?
感谢大家的帮助
【问题讨论】:
-
我不明白,你为什么需要
Form??
标签: attributes smarty product prestashop field-description