Magento: Disable module for any particular store

前端 未结 5 966
耶瑟儿~
耶瑟儿~ 2020-12-15 09:28

Suppose, I have 3 stores.

I want to disable a module in Store 2. I only want it to be enabled in Store 1 and Store 3.

I see that I can do it by:-

5条回答
  •  一向
    一向 (楼主)
    2020-12-15 09:47

    This configuration just disables module output in layout for frontend, but module controllers, event observers, admin pages, etc still working.

    Also don't forget to specify your module name in layout files definition, otherwise all the layout file content will be loaded for a particular store:

    
       
           
               yourlayoutfile.xml
           
       
    
    

    If you are developing a module and want to disable full its functionality on the frontent for a particular store, then you should create a configuration field of "Yes/No" type and check its value via Mage::getStoreConfigFlag('config/field/path') in your module code.

提交回复
热议问题