You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I notice that the affiliate commission takes into account the total order value, not just the product total value. (ie: Shipping cost) We only charge actual cost on shipping, so we lose money every time an affiliate gets a sale and gets a commisson where the shipping cost is included in the calculation. I need to be able to have the commission not include the shipping cost in the calculation of affiliate's commission. Does anyone know how to do this?
Offline
In the routine 'ste_order_conf_updateaff_proc' in the file ./cgi-bin/library/modules/ste_order.pl, look for:
$display_payment_method = "$gateway_name";
And right below it, add:
$affiliate_tracking_total = ($tracking_total - $tracking_shippingtotal);
Then, replace:
$commvalue = ($commvalue / 100); $commvalue = ($tracking_total * $commvalue);
With:
$commvalue = ($commvalue / 100); $commvalue = ($affiliate_tracking_total * $commvalue);
Replace:
$maxpayvalue = ($tracking_total * $maxpayvalue); } else { $maxpayvalue = "$affiliate_maxpayvalue"; } ######### End of if statement. if ($maxpayvalue > "$tracking_total") { $maxpayvalue = "$tracking_total";
With:
$maxpayvalue = ($affiliate_tracking_total * $maxpayvalue); } else { $maxpayvalue = "$affiliate_maxpayvalue"; } ######### End of if statement. if ($maxpayvalue > "$tracking_total") { $maxpayvalue = "$affiliate_tracking_total";
Then, lastly replace:
$salestd = ($salestd + $tracking_total); $salestd = sprintf("%.2f", $salestd);
With:
$salestd = ($salestd + $affiliate_tracking_total); $salestd = sprintf("%.2f", $salestd);
Offline
1) this doesn't work for me - i suspect it's because i use a custom shipping calculation and $tracking_total is not defined
2) it would be appropriate to exclude sales tax from the sales total as well
Can you advise what other variable we could use?
Rather than start with the total and figure out how to subtract multiple things,
isn't there an "item subtotal" variable available?
Offline
The subtotal number is not stored. It is always calculated as:
$subtotal = ($tracking_total - $tracking_stateprovtax - $tracking_countrytax + $tracking_saletotal + $tracking_discounttotal - $tracking_shippingtotal);
Offline
Hi,
Kaz - did you get this sorted??
Offline