Magento-1.9 Overrides – How to Override grouped.phtml File in Custom Module

ce-1.9.1.0grouped-productsmagento-1.9overridesphtml

I want to overwrite grouped.phtml file located at

app\design\frontend\rwd\default\template\catalog\product\view\type\

path in my own module. My magento version is 1.9.1.0.

Please guide me.

Best Answer

Create New Layout file at Custom Module:

You can do this layout.First need to create a frontend layout file customgrouped.xml from this custom module like this.

<?xml version="1.0" ?>
<config>
    <modules>
        <Amit_Custommodule>
            <version>1.0.0</version>
        </Amit_Custommodule>
    </modules>
    <!-- start of routers 
    -->
    <frontend>
        <layout>
            <updates>
                <custommodule>
                    <file>customgrouped.xml</file>
                </custommodule>
            </updates>
        </layout>
    </frontend>
</config>

Change template file at new layout file

then on customgrouped.xml file using grouped.phtml name and using setTemplate function set template .

<?xml version="1.0"?>
<layout version="0.1.0">
<!--
PRODUCT_TYPE_grouped for only grouped product view page
-->
    <PRODUCT_TYPE_grouped> <!--  grouped.phtml  block name define at catalog.xml -->
        <reference name="product.info.grouped">
              <action method="setTemplate"><template>youpath/customgrouped.phtml</template></action>
        </reference>
    </PRODUCT_TYPE_grouped></layout>
Related Topic