Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oreales/8966439 to your computer and use it in GitHub Desktop.
Save oreales/8966439 to your computer and use it in GitHub Desktop.
<?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