Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 05-12-2019 21:29:04

From: Fairview, PA
Registered: 11-19-2003
Posts: 549

Order Confirmation Script

Where is the best place to run a custom script every time an order is completed?  Would the best spot be in the "Dashboard / Store / Component / Settings / Affiliate Settings" --  Custom Script?  Does this fire after a POS order is entered?

I need the script to run every time an order is placed both online and when entered in the POS backend. 

Is it possible to have a button also in the Order Manager that runs my script for an order?  I found where the buttons are generated in the code, I just couldn't quite get the script to run using a button I generated.


Hat Trick Sports, LLC



#2 05-13-2019 06:35:47

From: York, PA
Registered: 04-20-2001
Posts: 19512

Re: Order Confirmation Script

There is a canned custom script located at {private}/apps/ecom/ECOM_OrderMan/comp/0400_compcustom.php which runs when orders are completed.  In that script, there is an empty exec function in which you can put whatever code you like. 

To get a button in admin, it would be best to place a custom include in {private}/apps/ecom/ECOM/includes, let's say you call it 'custombutton.php' and then point to it using a backend-only namespace entry in the core_namespaces table.  Using a 'pointer' with just the filename ('custombutton.php') and put it in the admin menu somewhere.  In that custom include, print a form with a button that posts back to the same namespace with a parameter like 'doscript=1', and in your include either print a button or execute code based on the value of that parameter. 

For an example of a button that does something, take a look at {private}/core/CORE/includes/helperdemodata.php and it's corresponding namespace core.helperdemodata.  Be aware that's a core namespace, and you'll probably want to put yours in ecom.

Nick Hendler



Board footer