views:

228

answers:

2

hello,

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

A: 

You could always override the Mage_Catalog_Block_Product_List block with a block in your own module and then reimplement the _getPriceBlockTemplate method which is used by the call to getPriceHtml for the product list. This should allow you to specify your own price templates for this block specifically, giving you control over not only the catalog page lists, but the ones for related and upsell products as well.

Hope that helps!

Thanks, Joe

Joseph Mastey
A: 

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