X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   order confirmation: insert code (https://forum.x-cart.com/showthread.php?t=68875)

yvesk 03-17-2014 06:10 AM

order confirmation: insert code
 
Hi

I need some help to put a small php script into the order process.

Once an order is placed and the confirmation page is shown with the invoice (cart.php?mode=order_message&orderids=XXX), I would like to run a small php script. (this script will create an account on our FTP server).

I donâ–“t find where to insert the portion of code. Witch is the best file for this ?

Thanks

totaltec 03-17-2014 09:28 AM

Re: order confirmation: insert code
 
Look in /include/func/func.order.php

yvesk 03-19-2014 02:29 AM

Re: order confirmation: insert code
 
Thanks, I've tried to put the script in func_complete_order put it doesn't work.
Any idea ?

totaltec 03-19-2014 04:52 AM

Re: order confirmation: insert code
 
Order complete is for orders that have been shipped. Look in func_process_order()

cflsystems 03-19-2014 10:03 AM

Re: order confirmation: insert code
 
Look in the script that actually shows the order confirmation message. Doing this is order status change or order process or order placement... will re-run the code every time one of them is run.
The order_message portion is either in cart.php or include/checkout_init.php. This is the code that runs on successful order placement and shows the confirmation - so it is run once

totaltec 03-19-2014 10:09 AM

Re: order confirmation: insert code
 
Very cool Steve, I've always done it the other way. I like this method much better. One question, what about manually setting the order to processed? Will order confirmation run in that case?

cflsystems 03-19-2014 10:15 AM

Re: order confirmation: insert code
 
mode=order_message runs only after order placement and if order was successfully placed - regardless if it was paid for, processed or queued.
Changing order status from admin does not run this code

totaltec 03-19-2014 12:28 PM

Re: order confirmation: insert code
 
So this is not a great solution if you want the function to run after an order was paid for or processed. But if it is based on order placement it sounds perfect! Thanks Steve.

cflsystems 03-19-2014 12:39 PM

Re: order confirmation: insert code
 
The original questions was for
Quote:

Once an order is placed and the confirmation page is shown with the invoice
so this is the way to do it. But yes if you need the code to run on status change it will be in func.order.php

DOPS85 04-02-2014 06:05 PM

Re: order confirmation: insert code
 
Has anyone had luck placing the adwords conversion tracker in either of the above templates?


All times are GMT -8. The time now is 05:34 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.