Magento – override payment/methods.phtml in custom extension

magento-1moduleoverridespayment-methodstemplate

I am creating custom extension in my magento site. In this extension i need to add my own code while selecting Bank Transfer Payment method.

So basically I need to override payment/methods.phtml.

Magento File Full Path : app/design/frontend/base/default/template/checkout/onepage/payment/methods.phtml

I have created same file in my custom directory.

My custom module full path:

app/design/frontend/base/default/template/market/methods.phtml

  • market is my module directory name

My xml path resides at :

app/design/frontend/base/default/layout/my_market.xml

Code wriitten in xml to override:

<checkout_onepage_index>
         <reference name="checkout.onepage.paymentmethods">
            <action method="setTemplate">
                <template>market/methods.phtml</template>
           </action>            
        </reference>
</checkout_onepage_index>

I think reference name is wrong. Please someone help which reference name should I use to override payment/methods.phtml. 🙂

Best Answer

You SHould use below code to override methods.phtml

<checkout_onepage_paymentmethod>
        <remove name="right"/>
        <remove name="left"/>

        <block type="checkout/onepage_payment_methods" name="root" output="toHtml" template="codverify/methods.phtml">
            <action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
        </block>
    </checkout_onepage_paymentmethod>
Related Topic