Check if a module is enabled in Magento 1

Spread the love

Check From Magento Backend

To check if a module is installed, or activated, first take a quick look from your Magento backend.
Go to System > Configuration > Advance (bottom left)
Then check your module name there. If your module’name is here. It is enabled. Even if you see the module output is set to disable.

Check if Magento module is enabled

How to check if a module is enabled programmatically in Magento 1?

Below is the code you can use to check if a module of your Magento is enabled or not.

isModuleEnabled function is implemented in Mage_Core_Helper_Abstract, which is located in app/code/core/Mage/Core/Helper/Abstract.php

Solution for older version of Magento

It might not be implemented in older versions of Magento, e.g. CE.1.4. If it is so, then you can use the following code to check whether a module is enabled.

When and why you need to check if a module is enabled

Checking if module is enabled is needed before you actually start using the module, for example if you want to load the helper of a module on a view, we can the use the code below,

Mage::helper('XXX_XXXX’);

But if you don’t check if the module is enabled or not before, you are likely to get an error when the module is disabled:

Class 'XXX_XXXX_Helper_Data' not found in xxxxxxxxx  on line xxxx

Note: the code above only checks if the module is enabled or installed, if will not check if the module output is enabled or not.

Leave a Reply

Your email address will not be published. Required fields are marked *