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

Stop event from dispatching second time
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

I would like an event to happen only once, the problem is that I have a procedure that is triggered by the event, but then triggers the event again. How can I except the second event from happening?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagePsycho
Mentor
 
Avatar
Total Posts:  1702
Joined:  2009-06-23
 

You should store the flag in some table(may be custom) or if its related to eav table then you can create a custom attribute with default value say 0.
When the event is fired, check that attribute.
If its 0 -> update to 1& operate accordingly
else do nothing.

Thanks

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