Given a plugin defined in di.xml such as the following:
<type name="\Magento\Catalog\Model\Product"> <plugin name="se_catalog_product_plugin_ample" type="Example\Module\Model\Plugin\Catalog\Product" sortOrder="10" disabled="false" /> </type>
How can I disable this defined plugin programatically (so not via di.xml but in code)? So when Magento comes round to processing the
se_catalog_product_plugin_ample plugin, it is disabled, as if the node above had
I need to be able to alter this plugin programatically due to the requirement of reacting to store config differing in seperate store views in use in the environment. This config can't be reacted upon in di.xml (as far as I know).
Not sure if this is even possible. I know it would be possible to add logic inside the plugin to just
$proceed() based on whatever condition needed, but this is one module wanting to disable another that I don't want to have tightly coupled. i.e. the module
Example_Foo wants to disable a plugin in