Magento Forum

   
Event sales_order_invoice_save_after fired twice
 
ricardoinvent
Member
 
Total Posts:  37
Joined:  2012-10-29
 

Hello friends

I did an observer for the event sales_order_invoice_save_after to export some data each time the admin creates an invoice. But I see that this event is fired twice . Could some body helpme to know how to prevent this?.

Maybe creating a flag or something?. But where?..

Kind regards!

 
Magento Community Magento Community
Magento Community
Magento Community
 
ricardoinvent
Member
 
Total Posts:  37
Joined:  2012-10-29
 

Please, could somebody helpme??

I’m saving the invoice and order data to SQL Server DB. And the connection is working but It always fired twice. I mean, the data is saved twice in the database.  I’m desperate. I tried with everything:

1.- I’ve created a flag in the observer using the registry and it doesn’t work.
2.- I’ve also created a method that verify the DB to check if the Invoice is already register and then continue with the registration of the data but it doesn’t work. Magento simply fires the event two times.
3.- I’ve also try with “sales_order_invoice_save_before” and “sales_order_invoice_register” without success.

Nothing is working. Could somebody point me in the right direction?. I really need help on this!

Kind regards!

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