5

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.

asked Oct 1, 2016 at 5:18

1 Answer 1

3

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
3
  • 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? Commented Oct 7, 2016 at 1:12
  • And where should I put the new template files in my custom module? Commented 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/extensionfolder Commented Oct 7, 2016 at 13:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.