use own price.phtml price template for category list page

tried some tips by googled. If i want to change price template for product view page, it is easy. Some like these codes.

    <PRODUCT_TYPE_simple>
        <reference name="product.info.simple">
            <action method="setTemplate">
                <template>catalog/product/price-custom.phtml</template>
            </action>
        </reference>
    </PRODUCT_TYPE_simple>

Since PRODUCT_TYPE_simple and product.info.simple are defined in catalog.xml

I tried to change price template for category list page by using change the xml under my theme, directly.

Add

<action method=”addPriceBlockType”><type>simple</type><block>catalog/product_price</block><template>catalog/product/price_from.phtml</template></action>
<action method=”addPriceBlockType”><type>configurable</type><block>catalog/product_price</block><template>catalog/product/price_from.phtml</template></action>

to <catalog_category_layered>
<reference name=’product_list’>

but i did not work.

Finally, i used the same code. Just put the codes in local.xml.

<?xml version=”1.0″?>
<layout version=”0.1.0″>
<catalog_category_layered>
<reference name=’product_list’>
<action method=”addPriceBlockType”><type>simple</type><block>catalog/product_price</block><template>catalog/product/price_from.phtml</template></action>
<action method=”addPriceBlockType”><type>configurable</type><block>catalog/product_price</block><template>catalog/product/price_from.phtml</template></action>
</reference>
</catalog_category_layered>
</layout>

It works.

 

Leave a Reply

Your email address will not be published. Required fields are marked *


× three = 6

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>