如何为magento添加新的价格模板

naf*_*fex 2 php templates magento

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

非常感谢您的帮助.nafex

naf*_*fex 10

经过长时间的互联网搜索,我找到了一个很好的方法:

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

<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>
Run Code Online (Sandbox Code Playgroud)

块:

<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
Run Code Online (Sandbox Code Playgroud)