Hey All

I use the module: uc_discounts
I use this module to do a "Fixed amount off per qualifying item"
For example when a user orders 12 items it gets 1 euro off for every item.

When i look /admin/store/affiliate/reports i see:
Affiliate Sales Commissions Paid (click to edit)
testAf €107,40 €5,97 €0,00

My commission is 5%, but 107,40*0.05 = 5,37
After culcalution i found out it's not using this 107,40, but it's using 119,4 (that is the total without the discount)
I think it's strainge that i can see the right price in the "Sales" colum, but the calculation is not done right?

I will try to find it in the code, but i'm more a designer...

Comments

janton’s picture

I read in this old forum: #986436: Commissions applied against subtotal, not discounted total that it was fixed 2.6 but i still have this? Or do they mean i need to use the patch from #630152: affiliate payment excludes VAT / taxes

I looked at the patch from #630152: affiliate payment excludes VAT / taxes but i notice this is already in the code, except the end part, but this also look different in the current version..

 // sum the prices of products from each affiliate store
     foreach ($order->products as $product) {
       //TODO enable setting for excluding certain products from commissionable total
       if (isset($product->data['affiliate'])) {
+        $price_info = array(
+          'price' => $product->price,
+          'qty' => ($product->qty) ? $product->qty : 1,
+        );
+        $context['subject']['product'] = $product;
+        $context['subject']['node'] = node_load($product->nid);
+        $price = uc_price($price_info, $context);
+
         $aff = $product->data['affiliate'];
-        $price = $product->price * $product->qty;
         $affcom[$aff]['total'] = isset($affcom[$aff]['total']) ? $affcom[$aff]['total'] + $price : $price;
         $affcom[$aff]['nid'] = $product->nid;
       }
hippypimp’s picture

I am having the same issue. I double checked the version of UC_afiliate2 and i am running the 6x-2.6 . I am a little behind on Ubercart just because of testing slowness. I looked at "#986436: Commissions applied against subtotal, not discounted total" ( thanks Janton); However I didnt test against UC_Discounts only UC_Coupons. The Patch looks like it should work on either discount method since it takes the $price variable and not the $product->sell_price.
any ideas?