Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i add a new price template to magento

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".

thank you very much for your help. nafex

like image 215
nafex Avatar asked Nov 26 '25 21:11

nafex


1 Answers

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

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>

to the block:

<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
like image 83
nafex Avatar answered Nov 28 '25 10:11

nafex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!