Hi all
Just a quick question that I'm hoping someone can help me with please. I have integrated PostAffiliatePro with my Zen shopping cart but have a small problem.
I have created my affiliate program to pay affiliates 20% of the value of the order. I have just had an order which was processed with a discount coupon used (20% discount) and this reduced the price of the product from £21.95 to £17.56.
However... PAP calculated the commission based on the original £21.95 and 'awarded' this as £4.39. It should be more like £3.51 (20% of £17.56).
The code that the PAP guys advise to use is this:
<?
$dbreq = $db->Execute("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '".(int)$orders->fields['orders_id']."' AND class = 'ot_subtotal'");
$totalCost = (number_format($dbreq->fields['value'],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>';
?>
but I presume that there must be some value that needs changing to pay the correct amount, once discounts have been taken into account?
Also, some products have an additional shipping cost added to them - does this mean if one of these are ordered through an affiliate link I will also pay commission on the shipping fee using the code that I have pasted above?
Please can anyone advise me what needs changing to fix this, I can dabble with the code OK with instructions but haven't got a clue about finding the answer to this!
Any help/advice would be greatly appreciated
Many thanks in advance
Phil



