You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Magento 2.2.2多店铺多主题场景下特定视图禁用模块方法

Hey there! Great question—yes, you absolutely can disable a module for specific store views in Magento 2.2.2, even with your multi-store setup using distinct themes. Let’s walk through the practical approaches you can use, based on your scenario:

1. Use the Admin Panel (For Modules With Store-Level Toggle)

Many core Magento modules and well-built third-party modules include a store-view-specific enable/disable toggle right in the admin. Here's how to use it:

  • Log into your Magento admin, head to Stores > Configuration
  • In the top-left dropdown labeled Store View, pick the exact store view where you want to disable the module (skip "Default Config" or "Website" unless you want to apply changes to a broader scope)
  • Navigate to the module's configuration section (core modules might live under Advanced or their functional category; third-party modules often have their own left-hand menu item)
  • Look for an "Enabled" or similar toggle, set it to No, then click Save Config
  • Don’t forget to flush cache: Go to System > Cache Management and refresh the relevant cache types
2. Command Line (Flexible for All Modules)

If the module doesn’t have an admin-level store view toggle, Magento’s CLI tools let you target specific store views directly. You’ll need two things: the module’s full name (e.g., Vendor_Module) and your target store view’s code (find this in Stores > All Stores):

  • SSH into your server and navigate to your Magento root directory
  • Run this command to disable the module for your chosen store view:
    bin/magento module:disable --store=your_store_view_code Vendor_Module
    
  • Clean cache and redeploy static content (required for production mode):
    bin/magento cache:clean
    bin/magento setup:static-content:deploy
    

Pro tip: This command adds the disable setting directly to the core_config_data table, which is safer than manual file edits.

3. Manual Database Edit (Last Resort)

Only use this if you can’t access the admin or CLI—always back up your database first!

  • Access your Magento database and open the core_config_data table
  • Look for or create a record with:
    • path: advanced/modules_disabled/Vendor_Module
    • scope: store
    • scope_id: The ID of your target store view (find this in the store table)
    • value: 1 (1 = disabled, 0 = enabled)
  • Save the record and flush your Magento cache to apply changes
Key Notes to Keep in Mind
  • Check module dependencies first with bin/magento module:status Vendor_Module—disabling a dependent module might break other functionality
  • If your store uses custom themes, double-check that the theme doesn’t rely on code from the module you’re disabling (this can cause frontend errors)
  • Always back up your code and database before making changes, especially in a production environment!

内容的提问来源于stack exchange,提问作者Toto Memeng

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:17:21