1

I added a custom field on order level and want to display in payment section remember its not payment method its custom optional field but not showing this is my code

<checkout_onepage_index>
     <reference name="head">
        <action method="setTitle" translate="title"><title>Faq</title></action>
    </reference>
    <reference name="checkout.onepage.payment">
        <block type="core/template"  after="methods" template="customponumber/customponumber.phtml" />
    </reference>
</checkout_onepage_index>
  • <checkout_onepage_index> <reference name="checkout.onepage.payment"> <block type="core/template" after="methods" template="customponumber/customponumber.phtml" /> </reference> </checkout_onepage_index> – imtia Aug 9 '18 at 15:59
0

Just adding your block, within a reference to checkout.onepage.payment is not sufficient (and after will have no effect).

The first thing you should do is add a name to your block, like:

<block type="core/template" name="customponumber" template="customponumber/customponumber.phtml" />

Then, you will need to edit template/checkout/onepage/payment.phtml, within your current theme.

Within payment.phtml, look for <?php echo $this->getChildHtml('methods') ?>, and add <?php echo $this->getChildHtml('customponumber') ?> below it; like so:

// app/design/frontend/[package]/[theme]/checkout/onepage/payment.phtml
...
<?php echo $this->getChildHtml('methods') ?>
<?php echo $this->getChildHtml('customponumber') ?>
...

You have to do this because the block you are referencing also uses a template, and does not automatically display all of it's children.

| improve this answer | |

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.