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.

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>
  • 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 Oct 7 '16 at 1:12
  • And where should I put the new template files in my custom module? – Shiran S Ekanayake Oct 7 '16 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 Oct 7 '16 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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