Disable/Enable module in magento using system.xml in magento -
i know how disable module output in system config going system>configuration>advanced , setting <active>false</active>
in etc/modules. want know how disable module using custom tab created using system.xml.
add code system.xml
<fields> <enable translate="label"> <label>enable</label> <frontend_type>select</frontend_type> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>0</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <comment>enable/disable module</comment> </enable> </fields>
and check in code: before first action in module.(this might in cron.php or observer.php or indexcontroller
)
$isenabled = mage::getstoreconfig('section_name/group_name/enable'); if (!$isenabled) { return; }
Comments
Post a Comment