How to Override Invoice PDF in Magento

How to Override Invoice PDF in Magento

Well designed and properly formatted invoices always make a good impression and sometimes badly required to fit enough and needful business information within. Defaut Magento neither provides adding more information nor allow customization as it’s way complicated. While working with one of our extensions, we need to change the layout & override default Invoice PDF in Magento to properly fit all the business information. You may require this custom code in your extension to fulfill custom requirements and thus I’m sharing my code here.

Put following code in Module config.xml file:

 
	
		NameSpace_ModuleName_Model
	
	
		
						NameSpace_ModuleName_Model_Order_Pdf_Invoice
			NameSpace_ModuleName_Model_Order_Pdf_Items_Invoice_Default
		
	

Now put following code in NameSpace/ModuleName/Model/Order/Pdf/Items/Invoice/ as Default.php


Simply change the code according to your requirements and test again.
I hope this code has helped you!
Cheers!
Previous Article

How to Override Configurable Product Price with Simple Product Price in Magento

Next Article

How to Programmatically Reorder in Magento

Write a Comment
  1. Mage::helper(‘core/string’)->str_split($loremipsum, 60, true, true) when i do this i get an error that the ‘…\…\…\Mage’ not found in my defaultInvoice.php file i suppose that Mage::helper should be available please guide i am stuck! thanks.

  2. Mage::helper(‘core/string’)->str_split($loremIpsum, 60, true, true);
    when i use this i get an error that ‘…\…\…\Mage’ is not found in my defaultInvoice.php file can you please guide.

Leave a Comment

Your email address will not be published. Required fields are marked *

Get Connect With Us

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨