1

I am trying to add payment method's info text to the PDF invoice but I can't figure out the right code.

Any ideas how to do this?

Payment method's info to the PDF invoice

1

This generally comes down to the specific implementation of the payment method. However the default payment methods provide this functionality by first defining a toPdf method - like this

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

    public function toPdf()
    {
        $this->setTemplate('payment/info/pdf/purchaseorder.phtml');
        return $this->toHtml();
    }
}

Which in this case will reference this template file. Your payment method might not have it's own specified toPdf method in which case you will end up using the default template which will affect all not specified payment methods.

To customise admin templates I would suggest your own admin theme, see here for details. Just copy the relevant file to the your theme and add your information there.

Another avenue to look into is to update the payment method to provide its specific information similar to how the CC method does it

0

In app/desing/adminhtml/default/default/template/payment/info/pdf/default.phtml

I write this line:

<?php echo $this->escapeHtml($this->getMethod()->getInstructions()) ?> 

and works

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.