View Single Post
  #25  
Old 03-05-2013, 07:50 AM
 
andrewmattress andrewmattress is offline
 

Advanced Member
  
Join Date: Feb 2013
Posts: 39
 

Default Re: XCart removing code from script. How to get code on page?

Okay... that was a stretch for me, but based on all the help offered in this post, as well as here:
http://forum.x-cart.com/showthread.php?t=44543

I was able to get the variables to display in debug mode.

Here are the relevant variables:

{$orderids}"12817"{$orders}Array (1)
0 => Array (4)
order => Array (77)
orderid => "12817"
login => "anonymous-13353"
membership => ""
total => "329.00"
giftcert_discount => "0.00"
giftcert_ids => ""
subtotal => "329.00"
discount => "0.00"
coupon => ""
coupon_discount => "0.00"
shippingid => "0"
tracking => ""
shipping_cost => "0.00"
tax => "0.00"
taxes_applied => "N;"
date => "1362493877"
status => "Q"
payment_method => "Phone Ordering"
email => "123testing@readingrainbow.com"

So I put in this code:

<!-- SpringMetrics Conversion Code for mattressinsider -->
<script type="text/javascript">
_springMetq.push(["setdata", {literal}{revenue: "{/literal}{$orders.order.total}{literal}"}]);
_springMetq.push(["setdata", { "orderId": "{/literal}{$orderids}{literal}" }]);
_springMetq.push(["setdata", { "email": "{/literal}{$orders.order.email}{literal}" }]);
_springMetq.push(["setdata", { "promoCode": "{/literal}{$orders.order.coupon}{literal}" }{/literal}]);
_springMetq.push(["convert", "sale" ]);
</script>
<!-- SpringMetrics Conversion Code for mattressinsider -->

Which gives this output:

<script type="text/javascript"> _springMetq.push(["setdata", {revenue: ""}]); _springMetq.push(["setdata", { "orderId": "12817" }]); _springMetq.push(["setdata", { "email": "" }]); _springMetq.push(["setdata", { "promoCode": "" }]); _springMetq.push(["convert", "sale" ]); </script> <!-- SpringMetrics Conversion Code for mattressinsider --></div>

Finally the Order ID works. So I assume I'm close now.

How do I get the rest of the fields to work? The email field is at the same level in the tree as the other fields.

Thank-you!
__________________
JK
X-Cart version 4.7
We have about lots of add-on modules.
Reply With Quote