Magento – Override Third Party Extension in Magento 2

extensionsmagento2overrides

How can I Override a Third Party Extension?
The Path for the Extension is: app/code/extension_company/extension/model/file.php

Can I Override this php File by my custom Theme?

Best Answer

Yes,You can use plugin at here.

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="extension_company/extension/model/file">
        <plugin disabled="false" name="overrider_the_third_part_file" sortOrder="10" type="[VendorName]\[ModuleName]\Plugin\FILE"/>
    </type>
</config>

Use after,before,around method basic of your requirement.

Related Topic