Robert
Robert

Reputation: 114

Magento: Add additional info to Invoice PDF

I am utilizing M2EPro to sync orders from eBay and Amazon.

I would like to add the Amazon Order ID and Ebay Order ID to my PDF invoices.

I need the data from:

Column amazon_order_id from m2epro_ebay_order

and

Column ebay_order_id from m2epro_amazon_order 

Can anyone offer suggestions as to a protected function to add to Abstract.php or any other solution?

Upvotes: 0

Views: 891

Answers (2)

Robert
Robert

Reputation: 114

Thank you for the help! I used:

$order = Mage::getModel('sales/order')->load(entity_id); 
$paymentInfo = Mage::helper('payment')->getInfoBlock($order->getPayment()) 
->setIsSecureMode(true);

$channelOrderId = $paymentInfo->getChannelOrderId();

Upvotes: 1

Cobolt
Cobolt

Reputation: 952

You should create models for the tables (if there aren't any available already) How to create a model Then you can simply get an instance of the model

$ebay = Mage::getModel('m2epro/ebay')->load($row_id);
echo $ebay->getData('ebay_order_id');

Upvotes: 0

Related Questions