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

add some conversion code only to thank you page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-24-2012, 05:13 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default add some conversion code only to thank you page

I was wondering how I would write an IF statement that said
Code:
{if page = thank you page} include some javascript code; {/if}

I have some conversion tracking code that is supposed to only be on the thank you page after a purchase is made. I can't just put it at the bottom of the home.tpl file because it can't be on every page. Thanks.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #2  
Old 01-24-2012, 06:52 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: add some conversion code only to thank you page

You need to put it in order_message.tpl - this template loads only when order is placed with the thank you page. No need of if statement
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 01-24-2012, 09:14 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: add some conversion code only to thank you page

that is where I had it originally but the guy over at the microsoft adCenter said I need to move the code to just before the closing BODY tag. I have had a problem with the code not reading conversions which is why they told me to move it. Does it really matter where on the page the javascript code is? I mean it should still work as long as I have it between the BODY tags right? The order_message.tpl only fills in the center of the page between the left and right columns so all the code for the right column comes below that .tpl. I didn't think it would matter.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #4  
Old 01-25-2012, 03:12 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: add some conversion code only to thank you page

Yes, in certain cases the code placement matters.

You should add it to "skin/%skin_name%/customer/home.tpl" template, but with some special conditions, e.g. like this:
Code:
{if $main eq "order_message"} your code goes here {/if}
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #5  
Old 01-25-2012, 06:15 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: add some conversion code only to thank you page

Thank you, exactly what I was looking for.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
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 01:24 AM.

   

 
X-Cart forums © 2001-2020