Magento 2 – Disable a Plugin in a Module from Another Module

magento-2.1magento2plugin

I've installed a vendor module which as a plugin in its di.xml.

What I intend to do is to write my own module to disable the plugin in that vendor module as I wanted to have my own functionalities for a particular part. Although I can modify that module's di.xml by setting its disabled attribute to true, since it's a vendor module, I try to avoid modifying it directly.

How can I disable a plugin in module A from another module B?

Best Answer

Edit: just saw that you already tried the solution below. AFAIK it's the only "clean" way of doing it

You can add the following in your own di.xml

<config>
    <type name="{ObservedType}">
        <plugin name="{pluginName}" disabled="true"/>
    </type>
</config>

Make sure your own module depends on the 3rd party module

Related Topic