Reputation: 101
When checking if the module is enabled or not I found this code
Mage::getConfig()->getModuleConfig('Mage_Checkout')->is('active', 'true')
But I think this is only applicable for modules that has <active>
tag in the config.xml
. In my case I disabled the Mage_Checkout module in the admin but it always shows active when I tried to call the function.
Is there another way to check if a certain module is disabled in the admin area? Thanks for the help!
Upvotes: 1
Views: 1352
Reputation: 14746
If you want to check module output is enabled or not from the admin then you can use
Mage::helper('core')->isModuleOutputEnabled("your_module_name")
Upvotes: 1
Reputation: 24551
You cannot really disable extensions from the admin panel. The "Disable Modules Output" configuration is a bit misleading, all it does is to skip rendering the blocks and admin menus of the respective module.
But of course you can check this configuration to hide or disable more things as appropiate. This is the check for Mage_Checkout
:
if (Mage::helper('core')->isModuleOutputEnabled("Mage_Checkout")) { ... }
Note that this will also return true
if the module is inactive, because it only checks if there is a "disable module output" configuration for this module. So you need to combine both checks:
if (Mage::helper('core')->isModuleOutputEnabled("Mage_Checkout") &&
Mage::getConfig()->getModuleConfig('Mage_Checkout')->is('active', 'true')) { ... }
Upvotes: 2
Reputation: 5501
if you want to disable the module you can do that by using code.
go to app\etc\modules
open the xml
file and set <active>true</active>
to <active>false</active>
and you can check module is active or not by checking the xml
Upvotes: 0