Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Understanding Event-Observer
 
sathyashrayan
Member
 
Total Posts:  39
Joined:  2009-03-19
Chennai
 

I wanted to understand the custom event creation. I saw some links where the custom event has be explained. Just to gain more knowledge, I have downloaded the attached module which is an extension that handles MLM marketing. Here the link,

http://www.magentocommerce.com/magento-connect/customer-experience/alternative-sales-models/qsolutions-magemlm-1928.html

In the file config.xml I see the observers. Here is the pastbin link

http://pastebin.com/G2Esx7xG

All the above observer functions is defined in

/var/www/magento/app/code/community/Qsolutions/Magemlm/Model/Observer.php

(pastbin link http://pastebin.com/PkeTNKJR)

My doubt is, I really dont know when the trigger fires and when the event occurs? Sorry if my question is very basic.

File Attachments
Qsolutions_Magemlm-0.1.5.tgz  (File Size: 32KB - Downloads: 1)
 
Magento Community Magento Community
Magento Community
Magento Community
 
TreInnova
Guru
 
Avatar
Total Posts:  465
Joined:  2009-02-20
Fano
 
sathyashrayan - 16 September 2013 04:09 AM

I wanted to understand the custom event creation. I saw some links where the custom event has be explained. Just to gain more knowledge, I have downloaded the attached module which is an extension that handles MLM marketing. Here the link,

http://www.magentocommerce.com/magento-connect/customer-experience/alternative-sales-models/qsolutions-magemlm-1928.html

In the file config.xml I see the observers. Here is the pastbin link

http://pastebin.com/G2Esx7xG

All the above observer functions is defined in

/var/www/magento/app/code/community/Qsolutions/Magemlm/Model/Observer.php

(pastbin link http://pastebin.com/PkeTNKJR)

My doubt is, I really dont know when the trigger fires and when the event occurs? Sorry if my question is very basic.

I suggest you this link Observer and dispatching events
Let me know if it’s usefull.
regards
Filippo Esposto.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sathyashrayan
Member
 
Total Posts:  39
Joined:  2009-03-19
Chennai
 

Hi thanks for the link. Now I understood that, the xml tags <customer_register_success>, <controller_front_init_before> are all events of magnto.  Those events will be called with Mage::dispatchEvent(). Now if I want to add my own event then I need to create that in the config.xml and use Mage::dispatchEvent() to dispatch an event. Correct?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

Yes, you can create / fire an event with the dispatchEvent function and catch it in your config.xml with an observer.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top