I have a problem with the PDF invoice and i'm trying to override the AbstractPdf.php file, I have done the following:
1)Created the following directories and files:
a. 'app\code\Ochos\fixPDF\registration.php':
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Ochos_fixPDF',
__DIR__
);
b. 'app\code\Ochos\fixPDF\etc\di.xml':
<?xml version="1.0" ?>
<config>
<preference for="vendor\magento\module-sales\Model\Order\Pdf\AbstractPdf" type="Ochos\fixPDF\Model\Order\Pdf\AbstractPdf" />
</config>
c. 'app\code\Ochos\fixPDF\etc\module.xml':
<?xml version="1.0"?>
<config>
<module name="Ochos_fixPDF" setup_version="2.0.0"/>
</config>
d. 'app\code\Ochos\fixPDF\Model\Order\Pdf\Abstract.php': the file that I have made changes in.
2)enabled the extension in config.php
3) Executed the following:
php -f bin/magento module:enable --clear-static-content Ochos_fixPDF
php -f bin/magento setup:upgrade
it seems that the extension is enabled, but no changes are made in the invoice PDF.
What am I doing wrong? Thanks!