Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

order confirmation: insert code

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-17-2014, 06:10 AM
 
yvesk yvesk is offline
 

Newbie
  
Join Date: Feb 2011
Location: France
Posts: 9
 

Default 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
__________________
version 4.4.4
version 4.5.1
Reply With Quote
  #2  
Old 03-17-2014, 09:28 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: order confirmation: insert code

Look in /include/func/func.order.php
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 03-19-2014, 02:29 AM
 
yvesk yvesk is offline
 

Newbie
  
Join Date: Feb 2011
Location: France
Posts: 9
 

Default Re: order confirmation: insert code

Thanks, I've tried to put the script in func_complete_order put it doesn't work.
Any idea ?
__________________
version 4.4.4
version 4.5.1
Reply With Quote
  #4  
Old 03-19-2014, 04:52 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: order confirmation: insert code

Order complete is for orders that have been shipped. Look in func_process_order()
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #5  
Old 03-19-2014, 10:03 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,195
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
totaltec (03-19-2014)
  #6  
Old 03-19-2014, 10:09 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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?
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #7  
Old 03-19-2014, 10:15 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,195
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
totaltec (03-19-2014)
  #8  
Old 03-19-2014, 12:28 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #9  
Old 03-19-2014, 12:39 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,195
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #10  
Old 04-02-2014, 06:05 PM
  DOPS85's Avatar 
DOPS85 DOPS85 is offline
 

Advanced Member
  
Join Date: Feb 2013
Posts: 32
 

Default Re: order confirmation: insert code

Has anyone had luck placing the adwords conversion tracker in either of the above templates?
__________________
X-Cart Version: 4.5.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:38 AM.

   

 
X-Cart forums © 2001-2020