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?

  • What payment method are you using? Authorize.net or Saved CC? – jharrison.au Apr 1 '13 at 22:55
  • @jharrison.au, I'm using authorize.net – veilig Apr 1 '13 at 23:00
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?

  • 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 – ivantedja Jul 6 '13 at 2:59

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.