Skip to content

Instantly share code, notes, and snippets.

@code-poel
Last active August 29, 2015 14:06
Show Gist options
  • Save code-poel/75735f53d007ea44eb17 to your computer and use it in GitHub Desktop.
Save code-poel/75735f53d007ea44eb17 to your computer and use it in GitHub Desktop.
Magento price template overrides via layout.xml.
<?xml version="1.0"?>
<!--
http://magento.stackexchange.com/questions/4748/how-rendering-of-price-phtml-in-catalog-product-listing-page-is-happening
http://magento.stackexchange.com/questions/14124/overriding-price-phtml-template-using-addpriceblocktype-in-magento-ce-1-7-0-2
-->
<layout>
<default>
<reference name="catalog_product_price_template">
<action method="addPriceBlockType">
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
</reference>
</default>
<!-- SCENARIOS -->
<catalog_category_default>
<reference name="product_list">
<!-- your addPriceBlockType methods here-->
</reference>
</catalog_category_default>
<catalog_category_view>
<reference name="product_list">
<!-- your addPriceBlockType methods here-->
</reference>
</catalog_category_view>
<catalog_category_layered>
<reference name="product_list">
<!-- your addPriceBlockType methods here-->
</reference>
</catalog_category_layered>
<catalog_product_compare_index>
<reference name="catalog.compare.list">
<!-- your addPriceBlockType methods here-->
</reference>
</catalog_product_compare_index>
<catalogsearch_result_index>
<reference name="search_result_list">
<!-- your addPriceBlockType methods here-->
</reference>
</catalogsearch_result_index>
<catalogsearch_advanced_result>
<reference name="search_result_list">
<!-- your addPriceBlockType methods here-->
</reference>
</catalogsearch_advanced_result>
<tag_product_list>
<reference name="search_result_list">
<!-- your addPriceBlockType methods here-->
</reference>
</tag_product_list>
<tag_customer_view>
<reference name="customer_view">
<!-- your addPriceBlockType methods here-->
</reference>
</tag_customer_view>
<default>
<reference name="cart_sidebar">
<!-- your addPriceBlockType methods here-->
</reference>
<reference name="wishlist_sidebar">
<!-- your addPriceBlockType methods here-->
</reference>
<reference name="catalog_product_price_template">
<!-- your addPriceBlockType methods here-->
</reference>
</default>
<catalog_product_view>
<reference name="catalog.product.related">
<!-- your addPriceBlockType methods here-->
</reference>
</catalog_product_view>
<PRODUCT_TYPE_simple>
<reference name="product.info.upsell">
<!-- your addPriceBlockType methods here-->
</reference>
</PRODUCT_TYPE_simple>
<checkout_cart_index>
<reference name="checkout.cart.crosssell">
<!-- your addPriceBlockType methods here-->
</reference>
</checkout_cart_index>
<PRODUCT_TYPE_bundle translate="label" module="bundle">
<reference name="product.info.bundle">
<!-- your addPriceBlockType only for bundle here-->
</reference>
<reference name="product.clone_prices">
<!-- your addPriceBlockType only for bundle here-->
</reference>
</PRODUCT_TYPE_bundle>
<rss_catalog_category>
<reference name="rss.catalog.category">
<!-- your addPriceBlockType methods here-->
</reference>
</rss_catalog_category>
<rss_catalog_new>
<reference name="rss.catalog.new">
<!-- your addPriceBlockType methods here-->
</reference>
</rss_catalog_new>
<rss_catalog_tag>
<reference name="rss.catalog.tag">
<!-- your addPriceBlockType methods here-->
</reference>
</rss_catalog_tag>
</layout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment