I have two template files that I need to override in a custom module. Those files are
app/design/frontend/<current-theme>/template/catalogue/category/view.phtml
app/design/frontend/<your-theme>/template/catalogue/product/view.phtml
Since I'm very new to Magento I have no idea of how to do that. Please help me on this.
1 Answer 1
Put the below code in your custom extension layout file:
app/design/frontend//template/catalogue/category/view.phtml
<catalog_category_view>
<reference name="category.products">
<action method="setTemplate">
<template>mymodule/catalog/category/view.phtml</template>
</action>
</reference>
</catalog_category_view>
app/design/frontend//template/catalogue/product/view.phtml
<catalog_product_view>
<reference name="product.info">
<action method="setTemplate">
<template>custom/catalog/product/view.phtml</template>
</action>
</reference>
</catalog_product_view>
Rohan Hapani
17.6k9 gold badges57 silver badges99 bronze badges
answered Oct 1, 2016 at 10:05
user41152
-
Hi @MageComp. Thank you for the answer. But still I got few things to clarify. What do you mean by the custom extension layout file?Shiran S Ekanayake– Shiran S Ekanayake2016年10月07日 01:12:58 +00:00Commented Oct 7, 2016 at 1:12
-
And where should I put the new template files in my custom module?Shiran S Ekanayake– Shiran S Ekanayake2016年10月07日 01:23:57 +00:00Commented Oct 7, 2016 at 1:23
-
In your custom extension you have frontend path like this: app/design/frontend/[Theme]/layout/extension.xml app/design/frontend/[Theme]/template/extensionfolderuser41152– user411522016年10月07日 13:01:10 +00:00Commented Oct 7, 2016 at 13:01
Explore related questions
See similar questions with these tags.
default