Forums / General Questions / Run custom script only after successful checkout

Run custom script only after successful checkout

Started by urgentprog on 22 Jun 2011, 11:41 PM · Views: 1,074

Results 1 to 7 of 7
22 Jun 2011, 11:41 PM
#1
urgentprog avatar

urgentprog

New Zenner

Join Date:
Jun 2011
Posts:
24
Plugin Contributions:
0

Run custom script only after successful checkout

Is it possible to run a php script upon successful checkout, after the customer has paid for an order, on zen-cart? Thanks.

23 Jun 2011, 12:32 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,739
Plugin Contributions:
0

Re: Run custom script only after successful checkout

'Most anything is possible ... What are you trying to do specifically?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

23 Jun 2011, 1:34 AM
#3
urgentprog avatar

urgentprog

New Zenner

Join Date:
Jun 2011
Posts:
24
Plugin Contributions:
0

Re: Run custom script only after successful checkout

I am looking to add a row in table in the same mysql database with the product quantity for a different php script.

29 Jun 2011, 8:49 PM
#4
urgentprog avatar

urgentprog

New Zenner

Join Date:
Jun 2011
Posts:
24
Plugin Contributions:
0

Re: Run custom script only after successful checkout

I think I can get it done by adding it to the payment module under includes/modules/payment. Is there a way to do this so I can update my table with all payment modules?

29 Jun 2011, 8:52 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Run custom script only after successful checkout

urgentprog:

I am looking to add a row in table in the same mysql database with the product quantity for a different php script.
Write your own custom observer class to hook the NOTIFY_ORDER_AFTER_ORDER_CREATE_ADD_PRODUCTS notifier point and do your custom database code insertion from that observer class.
There are many addons in the Addons section which use notifier/observer classes, and the concepts are outlined in the wiki.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

1 Jul 2011, 2:54 AM
#6
urgentprog avatar

urgentprog

New Zenner

Join Date:
Jun 2011
Posts:
24
Plugin Contributions:
0

Re: Run custom script only after successful checkout

Great! Thank you.

I got it coded but when I try testing with authorize.net sim I get

There has been an error processing your credit card. Please try again.

The debug email I get though says Response Text: (TESTMODE) This transaction has been approved.