0

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. :)

Raphael at Digital Pianism
70.8k37 gold badges192 silver badges357 bronze badges
asked Feb 2, 2016 at 7:00
6
  • Did you add layout updates from my_market.xml to your module config.xml? Commented Feb 2, 2016 at 7:04
  • Yes. I have successfully overridden some other templates from the front side like account,sidebar,payment review etc. which are from same xml file. Commented Feb 2, 2016 at 7:09
  • I think it a bad idea to change the template to add a custom payment method. Do you try to add it by JavaScript? I think I can try to implement some example in free time. Commented Feb 2, 2016 at 7:19
  • I want to override because I want to put my own method on the click of bank transfer checkout checkbox <input type="radio" class="radio" onclick="payment.switchMethod('banktransfer')" title="Bank Transfer Payment" name="payment[method]" value="banktransfer" id="p_method_banktransfer"> Commented Feb 2, 2016 at 7:29
  • Yes. I ll use jquery if i dont find solution of the above issue. payment.phtml has successfully overridden so i think payment/mehods.phtml should also override with some basic xml settings Commented Feb 2, 2016 at 7:34

1 Answer 1

1

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>
answered Jan 8, 2018 at 6:41

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.