Вопрос

I have a Magento 2.2.2 website with different storeviews. I have made som custom modules. Is that possible to have my custom modules only work for a specific storeview?

Это было полезно?

Решение

IMO, the simplest way could be you can create an admin configuration via xml file (yes/no) in store view scope to enable module, then before doing any logic you can check that.

Here is an example https://www.mageplaza.com/magento-2-module-development/create-system-xml-configuration-magento-2.html

Другие советы

If the extension develope to work at store level, then you can easily do that things like this.

  1. Open admin and go to configuration of extension.

  2. Check is there any field to make extension enable/disable ?

  3. If the field is available, then choose the storeview from dropdown for which you want disable the extension.

  4. Now disable extension and save configuration.

make caching and indexing and then check.

I would like to re-open this question. I have created module for Magento 2. I would like to extend it's functionality per store view. Is it possible to add this option to my existing module? My module is available in main menu - not in configuration page. Thanks for answers in advance.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top