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.

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>
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
    – user41152
    Commented Oct 7, 2016 at 13:01

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.