2

in the app/design/frontend/base/default/template/payment/form/cc.phtml template, around line 76, there is a spot to echo out child html. how do I reference that block to add a child into it?

I'm trying to add a section in my layout class, but it doesn't appear to be working correctly.

<?xml version="1.0"?>
<layout version="0.1.0">
 <checkout_onepage_index>
 <reference name="payment.method.authorizenet">
 <block type="abt_authnet/foo_bar_baz" name="foobar" as="foobar" template="abt/foobar.phtml" />
 </reference>
 </checkout_onepage_index>
</layout>

Am I doing this wrong? my feeling is I'm referencing the wrong block?

Marius
199k55 gold badges431 silver badges837 bronze badges
asked Apr 1, 2013 at 22:38
2
  • What payment method are you using? Authorize.net or Saved CC? Commented Apr 1, 2013 at 22:55
  • @jharrison.au, I'm using authorize.net Commented Apr 1, 2013 at 23:00

1 Answer 1

1

I have no experience with authorize.net but when I see this correctly, the template payment/form/cc.phtml is from Mage_Payment and therefore not from Authorize.net

But both templates from Authorize.net

  • authorizenet/directpost/form.phtml
  • authorizenet/directpost/iframe.phtml

has a <?php echo $_form->getChildHtml() ?> somewhere in the code, where you can echo any content.

But obviosuly this is in the review step:

<checkout_onepage_review>
 <reference name="checkout.onepage.review.info.items.after">
 <block type="directpost/form" name="payment.form.directpost" template="authorizenet/directpost/form.phtml">
 <action method="setMethodInfo"></action>
 </block>
 </reference>
</checkout_onepage_review>

So you can reference the form block:

<?xml version="1.0"?>
<layout version="0.1.0">
 <checkout_onepage_review>
 <reference name="payment.form.directpost">
 <block type="abt_authnet/foo_bar_baz" name="foobar" as="foobar" template="abt/foobar.phtml" />
 </reference>
 </checkout_onepage_review>
</layout>

Where is the payment.method.authorizenet from? Just a guess?

Raphael at Digital Pianism
70.8k37 gold badges192 silver badges357 bronze badges
answered Apr 7, 2013 at 0:49
1
  • seems like payment.method.authorizenet is from Mage_Checkout_Block_Onepage_Payment_Methods -> getPaymentMethodFormHtml, not really remember though. the block is created in Mage_Payment_Block_Form_Container -> _prepareLayout Commented Jul 6, 2013 at 2:59

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.