我如何向magento添加新的价格模板 [英] how can i add a new price template to magento

查看:86
本文介绍了我如何向magento添加新的价格模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不更改(template/catalog/product/view.phtml)中使用的价格模板的情况下将新的价格模板添加到类别视图(template/catalog/product/list.phtml)? 这两个文件都使用template/catalog/product/price.phtml,但是我需要在template/catalog/product/list.phtml中使用单独的价格模板,该模板不显示文本特价".

how can i add a new price template to the category view (template/catalog/product/list.phtml) without changing the price template that is used in (template/catalog/product/view.phtml)? both files uses the template/catalog/product/price.phtml, but i need a separate price template in template/catalog/product/list.phtml that don't show the text "special price".

非常感谢您的帮助. Nafex

thank you very much for your help. nafex

推荐答案

在互联网上搜索了很长时间之后,我发现了一种不错的方法:

after a long search time on the internet i found a nice way:

在catalog.xml文件中,我刚刚添加了动作:

in the file catalog.xml i just added the actions:

<action method="addPriceBlockType"><type>simple</type><block>catalog/product_price</block><template>catalog/product/new_price.phtml</template></action>
<action method="addPriceBlockType"><type>grouped</type><block>catalog/product_price</block><template>catalog/product/new_price.phtml</template></action>
<action method="addPriceBlockType"><type>configurable</type><block>catalog/product_price</block><template>catalog/product/new_price.phtml</template></action>

到区块:

<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">

这篇关于我如何向magento添加新的价格模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆