0

I want to customize the invoice PDF, so I believe I need to edit Magento 2 core files, please guide me how to achieve this task.

My purpose is customize the invoice PDF

Thanks

2

You can do it using preference tag.

inside app/etc/di.xml file,

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

<preference for="Magento\Sales\Block\Adminhtml\Invoice" type="Package\ModuleName\Block\Adminhtml\Invoice" />  

</config>

You can create invoice.php file inside Package\ModuleName\Block\Adminhtml folder and changes core data.

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.