Forked from oscar-reales-interactiv4/magento_module_enabled.php
Created
February 12, 2014 23:11
-
-
Save oreales/8966439 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//manera que utilizan muchas extensiones, aunque no es la recomendable, | |
//ya que magento incluye esta funcionalidad en su core | |
$modules = Mage::getConfig()->getNode('modules')->children(); | |
$modulesArray = (array)$modules; | |
if($modulesArray['Module_Name']->is('active')) { | |
echo "module is active."; | |
} else { | |
echo "module is not active."; | |
} | |
//y la manera "magento": | |
if(Mage::helper('core')->isModuleEnabled('Module_Name')) | |
{ | |
//codigo si modulo esta activo | |
} | |
//y una tercera manera aportada por @barbanet | |
Mage::getConfig()->getModuleConfig('Module_Name')->active; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment