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.
-
Were you able to solve it?Black– Black2022年02月16日 09:54:36 +00:00Commented Feb 16, 2022 at 9:54
1 Answer 1
There are three different ways to disable a module.
- This file -
app/etc/config.phpthen 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
-
Hi @Vibhore Jain, i dont want to disable the whole Amasty_Gdpr module. i just want to disable one of its plugins.mendz– mendz2021年05月03日 08:11:48 +00:00Commented May 3, 2021 at 8:11
-
Try comment the <plugin> tag in all related files.Vibhore Jain– Vibhore Jain2021年05月03日 08:17:48 +00:00Commented May 3, 2021 at 8:17
-
Your above code seems ok, run setup upgrade and compile it again, deploy -f , chmod 777 var pub, then clean: cache..Vibhore Jain– Vibhore Jain2021年05月03日 08:28:36 +00:00Commented May 3, 2021 at 8:28
-
@VibhoreJain You clearly don't understand his questionBlack– Black2022年02月16日 09:54:20 +00:00Commented Feb 16, 2022 at 9:54