Skip to main content
Tweeted twitter.com/StackMagento/status/1374239499484590080
added 4 characters in body; edited tags
Source Link
Khoa TruongDinh
  • 32.3k
  • 11
  • 90
  • 156

How to override vendor/magento/module-sales/Model/Order/Pdf/Invoice.php filePdf Invoice in Magento 2?

Magento 2:

I was looking to add a custom text on the footer in pdf invoice. I have done this by adding a small piece of code here in this file

vendor/magento/module-sales/Model/Order/Pdf/Invoice.phpvendor/magento/module-sales/Model/Order/Pdf/Invoice.php

I know it's not good to edit core files, so how can i override this file?

I tried by placing the same file with directories in app/code/Local/Sales/Model/Order/Pdf/Invoice.phpapp/code/Local/Sales/Model/Order/Pdf/Invoice.php but not working.

How to override vendor/magento/module-sales/Model/Order/Pdf/Invoice.php file in Magento 2?

Magento 2:

I was looking to add a custom text on the footer in pdf invoice. I have done this by adding a small piece of code here in this file

vendor/magento/module-sales/Model/Order/Pdf/Invoice.php

I know it's not good to edit core files, so how can i override this file?

I tried by placing the same file with directories in app/code/Local/Sales/Model/Order/Pdf/Invoice.php but not working.

How to override Pdf Invoice in Magento 2?

Magento 2:

I was looking to add a custom text on the footer in pdf invoice. I have done this by adding a small piece of code here in this file

vendor/magento/module-sales/Model/Order/Pdf/Invoice.php

I know it's not good to edit core files, so how can i override this file?

I tried by placing the same file with directories in app/code/Local/Sales/Model/Order/Pdf/Invoice.php but not working.

Source Link

How to override vendor/magento/module-sales/Model/Order/Pdf/Invoice.php file in Magento 2?

Magento 2:

I was looking to add a custom text on the footer in pdf invoice. I have done this by adding a small piece of code here in this file

vendor/magento/module-sales/Model/Order/Pdf/Invoice.php

I know it's not good to edit core files, so how can i override this file?

I tried by placing the same file with directories in app/code/Local/Sales/Model/Order/Pdf/Invoice.php but not working.