【发布时间】:2012-03-22 09:57:21
【问题描述】:
我们正在开发一个 Magento 网上商店,它有两个类别。
我们想为类别一使用默认产品视图模板,为类别二使用自定义产品视图模板。
这可能吗?我们如何才能做到这一点?
* 编辑 - 解决方案 *
对于任何对此感到好奇的人。解决方案比我想象的要容易得多。
我只需要将这段代码放在相关类别的自定义布局更新部分,我必须将选项“应用于产品”设置为是!
<reference name="product.info">
<action method="setTemplate"> <template>catalog/product/view-recipe.phtml</template></action>
</reference>
* 编辑 * 我已尝试将此代码添加到 catalog.xml。
<CATEGORY_5>
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/view-recipe.phtml</template></action>
</reference>
</CATEGORY_5>
* 编辑 * 我已尝试将此代码添加到 catalog.xml:
<CATEGORY_5>
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/view-recipe.phtml</template></action>
</reference>
</CATEGORY_5>
这个代码到自定义布局更新部分:
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/view-recipe.phtml</template></action>
</reference>
我安装了补丁,但不幸的是仍然没有结果。
【问题讨论】:
-
Michael,如果我没记错的话,你应该把
<CATEGORY_5>块放在布局更新部分。你也试过了吗? -
我试过但没有成功。我不知道我们做错了什么。
-
嗨奥古兹。请参阅已编辑的开始帖子以获取解决方案!
标签: magento