Basically the scenarios are I have two store view one is for Pakistan and the other is for America. I want to enable the extension for one store and disable for other store?

Is there any way to do this?

  • You can do it by changing the store view and disabling the extension from the extension configuration. – Sumit Aug 30 at 6:29

You can go to "Store->Configurations", open the module configurations and then click on "Store View" and change it to the respective store and set it "Enable" or "Disable" accordingly.

enter image description here

  • when i select storeview e.g America ,the configuration page not display my module which i have added in it . – usman Aug 30 at 6:40
  • Which means, you haven't added system.xml and config.xml file for your module's configurations. Please add it as a best practise and use the "status" field to check either module is enable or disable – Rahul Anand Aug 30 at 6:52
  • <?xml version="1.0"?> <config xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <Extrafee> <Extrafee> <status>1</status> </Extrafee> </Extrafee> </default> </config> – Rahul Anand Aug 30 at 6:53
  • add a system.xml file in etc/adminhtml folder with setting of enable, disable. <field id="status" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Extra Fee</label> <source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model> </field> – Rahul Anand Aug 30 at 6:54
  • 1
    Thanks Usman. I am glad it helped you. – Rahul Anand Aug 30 at 12:48

A Magento 2 module can only be enabled/disabled globally. In shell php bin/magento module: you see the commands available for enable/disable.

It is common that you can have different configuration for different store views but you can not disable a module for a store view.

Check the admin settings for the module and see if there is any leads to inactivate features in the module for a specific store view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.