Magento News
Magento: Event Observer Scope
I learned a valuable lesson this weekend (the hard way of course) when it comes to event observers in Magento. You’ve got 3 different places to setup your event observers in your config.xml file of your modules. They are as follows:
<config> <frontend> <events> ... </events> <frontend> <adminhtml> <events> ... </events> <adminhtml> <global> <events> ... </events> <global> </config>
It is pretty self-explanatory, but here’s how it works: Events are firing off all the time. If you are needing to observe an event, but only when it happens on the frontend, then you would put your observer in the ‘
I was trying to observe an event that should be fired off when an order is edited in the admin. I wasn’t able to log anything in my observer at all, and I couldn’t figure out why. Turns out it was because I had the event observer in the ‘
Possibly Related Posts:
- Database query different results
- Menu highlight in magento under admin
- magento disable a banner on certain category pages or have a banner with multiple links
- Magento, using ACL for frontend. Possible?
- Magento IE-7 Fix In Windows XP
RSS Feed