<?php
if ($_GET['main_page']=="checkout_success") { // If this is the checkout page, then insert the affiliate tracking code.
##########################################
## START JAM INTEGRATION WITH ZEN CART ##
## ZC Integration code by DrByte 8/2006 ##
##########################################
if ((int)$orders_id > 0) {
$JAM = $db->Execute("select class, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '".(int)$orders_id."' AND class in ('ot_coupon', 'ot_subtotal', 'ot_group_pricing')");
while (!$JAM->EOF) {
switch ($JAM->fields['class']) {
case 'ot_subtotal':
$order_subtotal = $JAM->fields['value'];
break;
case 'ot_coupon':
$coupon_amount = $JAM->fields['value'];
break;
case 'ot_group_pricing':
$group_pricing_amount = $JAM->fields['value'];
break;
}
$JAM->MoveNext();
}
$commissionable_order = ($order_subtotal - $coupon_amount - $group_pricing_amount);
$commissionable_order = number_format($commissionable_order,2,'.','');
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://www.someurlhere.com/affiliates/sale.php?amount=$commissionable_order&trans_id=$orders_id\"></script></td></tr>
</table>";
}
#######################################
## END JAM INTEGRATION WITH ZEN CART ##
#######################################
} // End if to determine if this is the checkout page
?>
Bookmarks