RSS

Add custom attribute to Magento invoice PDF

07 May

Look in the file app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php. That contains the part necessary for product output. Copy the file to a matching directory path but in app/code/local, this is a safe way to override and make edits. You should be able to see how the $lines array is used for positioning text.

Try inserting something like this either just before or just after the custom options.

// The quote item doesn't have any product attributes, it is only a quote! $product = Mage::getModel('catalog/product')->load($item->getProductId()); // Use the actual product object to add a new line. $lines[][] = array(     'text' => Mage::helper('core')->__('Manufacturer SKU: ') . $product->getManufacturerSku(),     'feed' => 35 );
You can try to change the position of attribute value by changing the value of feed. For more detail follow this link:-
http://inchoo.net/ecommerce/magento/how-to-add-custom-attribute-to-magentos-pdf-invoice/
 
Leave a comment

Posted by on May 7, 2012 in Magento, PHP

 

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: