Hey all,
right im trying to add our shopzilla tracking code to the checkout success page,
proposed code:
I know 'mid' 'order_value' and 'order_id' i know all work as i've tested this.PHP Code:<?php
$cn_orders = "SELECT count( orders_id ) FROM orders WHERE customers_id = '$customer_id'";
$cn_orders_result = $db->Execute($cn_orders);
if $cn_orders_result <= '1'{
$cn_orders_final = '1';
}
else{
$cn_orders_final = '0';
}
?>
<script language="javascript">
<!--
/* Performance Tracking Data */
var mid = '000000';
var cust_type = '<?php echo $cn_orders_final ?>';
var order_value = '<?php echo round($orders->fields['order_total'], 2); ?>';
var order_id = '<?php echo (int)$orders->fields['orders_id']; ?>';
var units_ordered = '<?php echo sizeof($order->products); ?>';
//-->
</script>
<script language="javascript" src="https://www.shopzilla.com/css/roi_tracker.js"></script>
I'm just trying to sort these last two fields and need a little bit of help.
I need 'cust_type' to display either a '0' or a '1' depending on if they have ordered before. So as i see it the above code should display a 0 if they have ordered 1 time or more, or a 1 if they have never ordered before.
for 'units_ordered' i saw on another post (http://www.zen-cart.com/forum/showth...e+number+items) that this piece of code should work for displaying number of items:
i basically just want to know if im right about these two things or if the extra bit of php code i added to find number of times the person has ordered is already present on the checkout screen before i implement this.PHP Code:<?php echo sizeof($order->products); ?>
regards
Andy.


Reply With Quote
