{"id":661,"date":"2019-11-06T11:36:32","date_gmt":"2019-11-06T11:36:32","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/11\/06\/override-method-of-abstract-file-of-magento-invoice-pdf\/"},"modified":"2025-09-01T11:42:48","modified_gmt":"2025-09-01T06:12:48","slug":"override-method-of-abstract-file-of-magento-invoice-pdf","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/override-method-of-abstract-file-of-magento-invoice-pdf\/","title":{"rendered":"How To Override a Method of Abstract File of Magento Invoice PDF"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I\u2019ve already given the solution to <a href=\"https:\/\/meetanshi.com\/blog\/override-magento-2-invoice-pdf\/\" target=\"_blank\" rel=\"noreferrer noopener\">override abstract file of Magento 2 invoice PDF<\/a> earlier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Similarly, I have come up with the solution for Magento 1 as I was required to do so as a part of the client\u2019s requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 <a href=\"https:\/\/meetanshi.com\/magento-upgrade-service.html\" target=\"_blank\" rel=\"noreferrer noopener\">upgrade to the latest Magento version<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The solution is to <strong>override abstract file of Magento invoice PDF<\/strong> and here\u2019s how:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to override abstract file of Magento invoice PDF:<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;models>\n    &lt;modulename>\n        &lt;class>NameSpace_ModuleName_Model&lt;\/class>\n    &lt;\/modulename>\n    &lt;sales>\n        &lt;rewrite>\n            &lt;order_pdf_invoice>NameSpace_ModuleName_Model_Order_Pdf_Invoice&lt;\/order_pdf_invoice>\n            &lt;order_pdf_items_invoice_default>NameSpace_ModuleName_Model_Order_Pdf_Items_Invoice_Default&lt;\/order_pdf_items_invoice_default>\n        &lt;\/rewrite>\n    &lt;\/sales>\n    &lt;downloadable>\n        &lt;rewrite>\n            &lt;order_pdf_invoice>NameSpace_ModuleName_Model_Order_Pdf_Invoice&lt;\/order_pdf_invoice>\n            &lt;sales_order_pdf_items_invoice>NameSpace_ModuleName_Model_Order_Pdf_Items_Invoice_Default&lt;\/sales_order_pdf_items_invoice>\n        &lt;\/rewrite>\n    &lt;\/downloadable>\n&lt;\/models><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please leave a comment below if you have any questions on the topic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Feel free to share the solution with fellow Magento developers too!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve already given the solution to override abstract file of Magento 2 invoice PDF earlier. Similarly, I have come up with the solution for Magento&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-661","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=661"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/661\/revisions"}],"predecessor-version":[{"id":21395,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/661\/revisions\/21395"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}