Open your module config.xml file and add this event.
<global> <events> <admin_system_config_changed_section_yoursectionname> <observers> <mymodule> <type>singleton</type> <class>mymodule/observer</class> <method>adminSystemConfigChangedSection</method> </mymodule> </observers> </
admin_system_config_changed_section_yoursectionname
> </events> </global>
Next create file in Model/Observer.php in model folder and add code.
class My_Module_Model_Observer
{
public function adminSystemConfigChangedSection()
{
echo "Test: oberver is working!";exit;
}
}
And clear cache and refresh browser ;)
Trying to get this test working. 2 questions. where would I see the "Observer is working" and how do I know the yoursectionname? Is that just the module name or?
ReplyDeleteThank you it saved my time
ReplyDeleteAwesome . It Worked
ReplyDeleteThanks for the best blog.it was very useful for me.keep sharing such ideas in the future as well.this was actually what i was looking for,and i am glad to came here!
ReplyDeletemagento development company in bangalore