Kryptronic Software Support Forum

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.

#1 09-23-2003 22:39:56

hpnow
Member
Registered: 09-18-2003
Posts: 22

Affiliate Commission Problem

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

 

#2 09-24-2003 15:28:38

hpnow
Member
Registered: 09-18-2003
Posts: 22

Re: Affiliate Commission Problem

any ideas?  smile

Offline

 

#3 09-25-2003 12:56:18

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Affiliate Commission Problem

In the routine 'ste_order_conf_updateaff_proc' in the file ./cgi-bin/library/modules/ste_order.pl, look for:

Code:


$display_payment_method = "$gateway_name";

And right below it, add:

Code:


$affiliate_tracking_total = ($tracking_total - $tracking_shippingtotal);

Then, replace:

Code:


$commvalue = ($commvalue / 100);
$commvalue = ($tracking_total * $commvalue);

With:

Code:


$commvalue = ($commvalue / 100);
$commvalue = ($affiliate_tracking_total * $commvalue);

Replace:

Code:


$maxpayvalue = ($tracking_total * $maxpayvalue);

} else {

$maxpayvalue = "$affiliate_maxpayvalue";

} ######### End of if statement.

if ($maxpayvalue > "$tracking_total") {

$maxpayvalue = "$tracking_total";

With:

Code:


$maxpayvalue = ($affiliate_tracking_total * $maxpayvalue);

} else {

$maxpayvalue = "$affiliate_maxpayvalue";

} ######### End of if statement.

if ($maxpayvalue > "$tracking_total") {

$maxpayvalue = "$affiliate_tracking_total";

Then, lastly replace:

Code:


$salestd = ($salestd + $tracking_total);
$salestd = sprintf("%.2f", $salestd);

With:

Code:


$salestd = ($salestd + $affiliate_tracking_total);
$salestd = sprintf("%.2f", $salestd);


Nick Hendler

Offline

 

#4 07-29-2004 15:39:40

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Affiliate Commission Problem

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?


Kevin Zaleski -  -

Offline

 

#5 08-13-2004 13:46:25

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Affiliate Commission Problem

The subtotal number is not stored.  It is always calculated as:

Code:


$subtotal = ($tracking_total - $tracking_stateprovtax - $tracking_countrytax + $tracking_saletotal + $tracking_discounttotal - $tracking_shippingtotal);


Nick Hendler

Offline

 

#6 04-28-2008 20:26:55

celdirect
Member
From: UK
Registered: 04-01-2005
Posts: 782

Re: Affiliate Commission Problem

Hi,

Kaz - did you get this sorted??

Offline

 

Board footer