How To Override a Method of Abstract File of Magento Invoice PDF
I’ve already given the solution to override abstract file of Magento 2 invoice PDF earlier.
Similarly, I have come up with the solution for Magento 1 as I was required to do so as a part of the client’s requirements.
We already know the importance of the attractive invoices that speaks for your brand. Adding a brand logo, signatures, etc. helps customers know who you are as a brand. And, it is important to be recognizable in the era of cutthroat competition.
And as I said in the earlier post, it is not wise to make the customizations in the default Magento invoice PDf. Because we do not want to lose our work when we upgrade to the latest Magento version.
The solution is to override abstract file of Magento invoice PDF and here’s how:
Method to override abstract file of Magento invoice PDF:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<models> <modulename> <class>NameSpace_ModuleName_Model</class> </modulename> <sales> <rewrite> <order_pdf_invoice>NameSpace_ModuleName_Model_Order_Pdf_Invoice</order_pdf_invoice> <order_pdf_items_invoice_default>NameSpace_ModuleName_Model_Order_Pdf_Items_Invoice_Default</order_pdf_items_invoice_default> </rewrite> </sales> <downloadable> <rewrite> <order_pdf_invoice>NameSpace_ModuleName_Model_Order_Pdf_Invoice</order_pdf_invoice> <sales_order_pdf_items_invoice>NameSpace_ModuleName_Model_Order_Pdf_Items_Invoice_Default</sales_order_pdf_items_invoice> </rewrite> </downloadable> </models> |
Please leave a comment below if you have any questions on the topic.
Feel free to share the solution with fellow Magento developers too!
Thanks.
Facing issues with your Magento store or want to add new features? Our Magento Development Services are here to help!
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How To Hide Add To Cart Button in Magento 2
Learn The Easiest Way To Add Magento Shopping Cart Price Rule
Next