I'm having trouble TAGGING on checkout success.
Here's what I have for code:
Code:
<!-- CHECKOUT SUCCESS TAGGING -->
<script type="text/javascript">
tagging.event("order", {
action: "purchase",
order: {
order_id: " <?php echo $order_summary['order_number']; ?>",
total: <?php echo $order_summary['order_total']; ?>,
discount: <?PHP echo $order_summary['credits_applied']; ?>,
subtotal: <?PHP echo $order_summary['order_subtotal']; ?>,
tax: <?PHP echo $order_summary['tax']; ?>,
shipping: <?PHP echo $order_summary['shipping']; ?>,
coupon_code: "<?PHP echo $order_summary['coupon_code']; ?>",
items: [
<? for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
{
product_id: "<?php echo $order->products[$i]['id']; ?>",
price: <?php echo $order->products[$i]['final_price']; ?>,
quantity: <?php echo $order->products[$i]['qty']; ?>,
subtotal: <?php echo ($order->products[$i]['final_price']*$order->products[$i]['quantity']); ?>
}
<? if ($i == $n-1) {} else { echo ",";} ?>
<? } ?>
]
}
});
</script>
<!-- END tagging-->
I have this saved in a file:
/includes/modules/pages/checkout_success
BUT, here's what gets outputted:
Code:
<!-- CHECKOUT SUCCESS TAGGING -->
<script type="text/javascript">
tagging.event("order", {
action: "purchase",
order: {
order_id: " ",
total: ,
discount: ,
subtotal: ,
tax: ,
shipping: ,
coupon_code: "",
items: [
{
product_id: "168",
price: 3.5000,
quantity: 2,
subtotal: 0 }
, {
product_id: "167",
price: 5.7000,
quantity: 1,
subtotal: 0 }
]
}
});
</script>
<!-- END tagging-->
Notice that NONE of the $order_summary values are populated.
I followed the details on this page:
https://www.zen-cart.com/content.php...els-to-my-site
Any help?
Bookmarks