Magento 2 cannot Disable 3rd party plugin
Domanda
Im trying to disable Amasty\Gdpr\Block\AccountLinkPlugin from my vendor folder.
Amasty frontend/di.xml
<type name="Magento\Customer\Block\Account\Navigation">
<plugin name="amasty-gdpr-account-navigation" type="Amasty\Gdpr\Block\AccountLinkPlugin"/>
</type>
so i tried creating a module to disable it.
module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Namespace_AmastyGdpr" setup_version="1.0.0">
<sequence>
<module name="Amasty_Gdpr" />
</sequence>
</module>
</config>
etc/di.xml (i also tried putting it in etc/frontend/di.xml)
<?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="Magento\Customer\Block\Account\Navigation">
<plugin name="amasty-gdpr-account-navigation" disabled="true"/>
</type>
</config>
already tried different approaches to make this work. like including the 'type' on the di.xml, but it didnt work. also saw a some question and solution here. but for some reasons its not working for me. im using 2.4.0.
im sure that im trying to remove the correct plugin cause when i tried to do
<type name="Magento\Customer\Block\Account\Navigation">
<plugin name="amasty-gdpr-account-navigation" type="Amasty\Gdpr\Block\AccountLinkPlugin" disabled="true"/>
</type>
directly on the amasty module, it did work.
Nessuna soluzione corretta
Altri suggerimenti
There are three different ways to disable a module.
- This file - /var/www/html/development_m241/m241/app/etc/config.php then find your module name, then make it to 0 from 1 , it will disable the module.
- To disable a module from command line.
For example, to disable the Weee module, enter:
$ bin/magento module:disable Magento_Weee
3. It may be helpful - https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange