gpt4 book ai didi

php - 如何向 magento 添加新的价格模板

转载 作者:行者123 更新时间:2023-12-04 23:22:03 25 4
gpt4 key购买 nike

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

非常感谢您的帮助。纳菲克斯

最佳答案

在网上找了很久,找到了一个不错的方法:

在文件 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>

到 block :

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

关于php - 如何向 magento 添加新的价格模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2911615/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com