Zen Cart Logo
Forums / Addon Payment Modules / Observable event for completing orders?

Observable event for completing orders?

Locked

Views: 1,585

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
3 Oct 2008, 3:03 AM
#1
912345 avatar

912345

New Zenner

Join Date:
Oct 2008
Posts:
3
Plugin Contributions:
0

Observable event for completing orders?

Greetings,

I'm in the process of creating a module. Basically, I need to be able to run some code based on an order after it is complete. It looks like the best way to do this is with an observer class that listens to an event. I see the list of events here:
http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#Notifiers_currently_set_in_Zen_Cart
but I'm not sure which event is appropriate. I want it to execute upon the order being completed regardless of the payment module used. Is there an event for that? If not at what part of the code would that occur?

Thanks,
Dave

3 Oct 2008, 3:13 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Observable event for completing orders?

NOTIFY_HEADER_END_CHECKOUT_PROCESS ... but won't work with PayPal.

3 Oct 2008, 4:26 AM
#3
912345 avatar

912345

New Zenner

Join Date:
Oct 2008
Posts:
3
Plugin Contributions:
0

Re: Observable event for completing orders?

I kinda need it to work with paypal IPN. Is there a way to add an event to the code? Where would it go? Maybe it's just me but it seems an event of a completed order would be rather useful.

3 Oct 2008, 2:45 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Observable event for completing orders?

The PayPal Website Payments Standard code in Zen Cart doesn't currently support the observer/notifier infrastructure. Thus, processing IPN data does not currently allow hooked events to be triggered via observers.
Express Checkout or Website Payments Pro payment completions would be handled fine though.

6 Oct 2008, 12:51 AM
#5
912345 avatar

912345

New Zenner

Join Date:
Oct 2008
Posts:
3
Plugin Contributions:
0

Re: Observable event for completing orders?

It seems that NOTIFY_HEADER_END_CHECKOUT_SUCCESS is actually a more appropriate event to use. NOTIFY_HEADER_END_CHECKOUT_PROCESS seems to occur when some clicks checkout in their shipping cart but NOTIFY_HEADER_END_CHECKOUT_SUCCESS occurs when they actually pay and complete their order which is what I want. I think that paypal express checkout will work just fine. Is there really any advantages to using IPN?