Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To disable a module on the store scope, I've found it's possible to do it like this:</p> <p>Move app/code/core/Mage/Core/Model/Config.php to app/code/local/Mage/Core/Model/Config.php</p> <p>Inside Config.php find the method "loadModulesConfiguration" Don't change anything, but add the following code to make the method look like this.</p> <pre><code>public function loadModulesConfiguration($fileName, $mergeToObject = null, $mergeModel=null) { $disableLocalModules = !$this-&gt;_canUseLocalModules(); if ($mergeToObject === null) { $mergeToObject = clone $this-&gt;_prototype; $mergeToObject-&gt;loadString('&lt;config/&gt;'); } if ($mergeModel === null) { $mergeModel = clone $this-&gt;_prototype; } $modules = $this-&gt;getNode('modules')-&gt;children(); foreach ($modules as $modName=&gt;$module) { if ($module-&gt;is('active')) { // Begin additional code if((bool)$module-&gt;restricted) { $restricted = explode(',', (string)$module-&gt;restricted); $runCode = (isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'default'); if(in_array($runCode, $restricted)) { continue; } } // End additional code if ($disableLocalModules &amp;&amp; ('local' === (string)$module-&gt;codePool)) { continue; } if (!is_array($fileName)) { $fileName = array($fileName); } foreach ($fileName as $configFile) { $configFile = $this-&gt;getModuleDir('etc', $modName).DS.$configFile; if ($mergeModel-&gt;loadFile($configFile)) { $mergeToObject-&gt;extend($mergeModel, true); } } } } return $mergeToObject; } </code></pre> <p>The new code will cause the method to also check for a new node in the module xml file, &lt;restricted&gt;. If the node exists, the value would be a comma separated list of store codes that you do NOT want the module to load on. If you have multiple stores, the $_SERVER variable "MAGE_RUN_CODE" should be set with the current store code. If it's not set, the script will fallback to assuming the store code is "default" which is what it is by default unless for some bizarre reason you decide to change that in the backend.</p> <p>A modules xml file could then look like this:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;MyPackage_MyModule&gt; &lt;active&gt;false&lt;/active&gt; &lt;restricted&gt;mystore1,mystore4,mystore5&lt;/restricted&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;/MyPackage_MyModule&gt; &lt;/modules&gt; &lt;/config&gt; </code></pre> <p>With this, the module will not even load while on the stores with a store code of mystore1, mystore4, or mystore5. The &lt;restricted&gt; tag is entirely optional, if you omit it the module will load as it normally would.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload