
Originally Posted by
marosf
Hi,
as you can see JROX and PAP do have very similar call of tracking code, and the same modification that is possible for JROX is possible for PAP too.
Below I'm posting an altered version of Dr Byte's or schoolboy's code for Post Affiliate Pro.
<?
$dbreq = $db->Execute("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '".(int)$orders->fields['orders_id']."' AND class in ('ot_coupon', 'ot_gv', 'ot_subtotal', 'ot_group_pricing')");
while (!$dbreq->EOF) {
switch ($dbreq->fields['class']) {
case 'ot_subtotal':
$order_subtotal = $dbreq->fields['value'];
break;
case 'ot_coupon':
$coupon_amount = $dbreq->fields['value'];
break;
case 'ot_group_pricing':
$group_pricing_amount = $dbreq->fields['value'];
break;
case 'ot_gv':
$gv_amount = $dbreq->fields['value'];
break;
}
$dbreq->MoveNext();
}
$totalCost = ($order_subtotal - $gv_amount - $coupon_amount - $group_pricing_amount);
$totalCost = number_format($totalCost,2,'.','');
$orderId = $dbreq->fields['orders_id'];
print '<script id="pap_x2s6df8d" src="http://canvascrew.co.uk/go/scripts/sale.js" type="text/javascript"></script> <script type="text/javascript">
var TotalCost="'.$totalCost.'";
var OrderID="'.$orderId.'";
var ProductID="";
papSale();
</script>';
?>