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)
-   -   add some conversion code only to thank you page (https://forum.x-cart.com/showthread.php?t=62428)

keystone 01-24-2012 05:13 AM

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.

cflsystems 01-24-2012 06:52 AM

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

keystone 01-24-2012 09:14 AM

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.

qualiteam 01-25-2012 03:12 AM

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}


keystone 01-25-2012 06:15 AM

Re: add some conversion code only to thank you page
 
Thank you, exactly what I was looking for.


All times are GMT -8. The time now is 01:29 AM.

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