1

I have created some custom options for payment. Like this article has suggested.

http://excellencemagentoblog.com/blog/2011/10/28/magento-create-custom-payment-method/

Now I want to show these custom column values to back-end order detail page and at invoice too.

Please guide How can I do this.

1 Answer 1

1

In your payment method you can assign an Info form block with setting (I took the Purchaseorder method as an example):

protected $_infoBlockType = 'payment/info_purchaseorder';

In this block you can assign the template file you want to use (see Mage_Payment_Block_Info_Purchaseorder for complete code):

protected function _construct()
    {
        parent::_construct();
        $this->setTemplate('payment/info/purchaseorder.phtml');
    }

And in this template file you can add info you want to dispay (the fields you added during the checkout):

<ul class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">
    <li>
        <label for="po_number" class="required"><em>*</em><?php echo $this->__('Purchase Order Number') ?></label>
        <div class="input-box">
            <input type="text" id="po_number" name="payment[po_number]" title="<?php echo $this->__('Purchase Order Number') ?>" class="input-text required-entry" value="<?php echo $this->escapeHtml($this->getInfoData('po_number')) ?>" />
        </div>
    </li>
</ul>

This will display the information entered at checkout in the order detail page.

2
  • Thanks for reply. I am already using this. And this code show value for front-end. And I am asking for back-end. I want to show these options to back-end Commented Dec 22, 2014 at 7:42
  • If you place your template file in the adminhtml/.... design directory this should also show up on your backend. Commented Dec 22, 2014 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.