作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何在不更改 (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/
我是一名优秀的程序员,十分优秀!