How to overwrite: catalog/product/view/type/default.phtml with XML Magento -


i have simple module , want overwrite templates files.

for instance, when want overwrite view.phtml via xml open module layout xml file , add:

<catalog_product_view>   <reference name="product.info">     <action method="settemplate">       <template>my-module-template-folder/catalog/product/view.phtml</template>     </action>   </reference> </catalog_product_view> 

but want overwrite: catalog/product/view/type/default.phtml , have tried nothing works. (to bad way easy) thought add <action method="settemplate"> new file nothing offcourse.

can please provide me right code?

either put copy of catalog/product/view/type/default.phtml design override under app/design/frontend/default/<yourdesign>/template/.
or can use unset in layout xml @ first before redefining block setting template again.

take @ app/design/frontend/base/default/layout/catalog.xml:268

<product_type_simple translate="label" module="catalog">     <label>catalog product view (simple)</label>     <reference name="product.info">         <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/default.phtml">             <block type="core/text_list" name="product.info.simple.extra" as="product_type_data_extra" translate="label">                 <label>product info</label>             </block>         </block>     </reference> </product_type_simple> 

you might want reference product.info.simple within product_type_simple.

<product_type_simple>     <reference name="product.info">         <!-- <action method="unsetchild"><name>product.info.simple</name></action> -->         <action method="settemplate">             <!-- app/design/frondend/default/<yourdesign>/template/my-module-template-folder/catalog/product/view.phtml -->             <template>my-module-template-folder/catalog/product/view.phtml</template>         </action>     </reference> </product_type_simple>  

edited after reply:

thanks reply. share outcome works:

<product_type_simple>     <reference name="product.info.simple">         <action method="settemplate">             <template>my-modus-template-folder/catalog/product/view/type/default.phtml</template>         </action>     </reference> </product_type_simple> 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -