Determine if Magento module is enabled
Solution 1
If you would like to use a build in function just use
Mage::helper('core')->isModuleEnabled(<module name>);
It is implemented in
Mage_Core_Helper_Abstract
Solution 2
Here's another option that is a more elegant way of finding out the status:
Mage::getConfig()->getModuleConfig('modulename')->is('active', 'true')
Colin O'Dell
I am the Lead Web Developer for Unleashed Technologies, LLC based in the Baltimore, MD area. I primarily develop in PHP, JavaScript, C# and Java. Database experience includes MySQL, MS SQL Server, and Redis. Primary frameworks include Symfony2, Magento, and Zend Framework. I also enjoy tinkering with Ubuntu Linux and developing stuff for Android.
Updated on November 29, 2020Comments
-
Colin O'Dell over 3 years
What is the best way to determine if a particular module is enabled/active in Magento? I've tried using
class_exists
to check if my code has been loaded and parsed by PHP but lately I've noticed its pretty unreliable (returnstrue
even when I delete the module's .xml configuration).Is there a core function I can call?