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)
-   -   variable for order total (https://forum.x-cart.com/showthread.php?t=62458)

keystone 01-26-2012 11:14 AM

variable for order total
 
I am trying to set up my google conversion analytics and supposedly I can use this
Code:

<!-- Google Code for Placed Order Conversion Page -->
<script type="text/javascript">
<!--
var google_conversion_id = xxxxxxxxxx;
var google_conversion_language = "en_US";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "Xxxxxxxxxx";
var google_conversion_value = 0;
if (<? echo $order.total ?>) {
  google_conversion_value =<? echo $order.total ?>;
}
//-->
</script>
<script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
...


I have 2 questions, 1. is $order.total the correct variable for the order total on the thank you page, and for the line
Code:

google_conversion_value =<? echo $order.total ?>;
should there be a ; or no ;? The code snippet on googles page had it without the ; but it wasn't working so I added it. (still doesn't work) but i'm not sure if it is because my variable is wrong or the ;.
Anyone know?
Thanks.

qualiteam 01-26-2012 10:16 PM

Re: variable for order total
 
As far as I understand you want this code on the order message page.
If so you should alter the "skin1/customer/main/order_message.tpl" template.

I suppose you can use {$order.total} in the main orders {foreach}

Code:

{foreach from=$orders item=order}
... {$order.total} ...
{/foreach}



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

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