I am trying to disable a Magento programatically.For just trying I added the following code to myadmin header.phtml.
// Disable the module itself
$moduleName="Thycart_Customcheckout"
$nodePath = "modules/$moduleName/active";
if (Mage::helper('core/data')->isModuleEnabled($moduleName)) {
Mage::getConfig()->setNode($nodePath, 'false', true);
echo Mage::getConfig()->getNode('modules/Thycart_Customcheckout')->active;
}
// Disable its output as well (which was already loaded)
$outputPath = "advanced/modules_disable_output/$moduleName";
if (!Mage::getStoreConfig($outputPath)) {
Mage::app()->getStore()->setConfig($outputPath, true);
}
On echoing
Mage::getConfig()->getNode('modules/Thycart_Customcheckout')->active;
is returning me its false but actualy the module is not getting disabled from xml.
Also tried
Mage::getConfig()->saveConfig();
returned a
Front controller reached 100 router match iterations
Error.
Can someone please help to make the node active to false in config file . Thanks.
app/etc/Namespace_Modulename.xml
you can do it. Open the file and setactive
to false. Or just rename the file to something likeNamespace_Modulename.xml_bak
.