Page 1 of 2

Affiliate commision of shipping...

Posted: Fri Jul 01, 2011 1:10 am
by Tromas
Is there a way to avoid commison being paid for the the shipping cost?
(Except to offer free shipping :joker: )

Re: Affiliate commision of shipping...

Posted: Fri Jul 01, 2011 9:32 am
by mberlant
That sounds like a bug. Commission should only be paid on the base price of goods and not on any ancillary charges (shipping, taxes, handling, etc.) added to the base price.

Re: Affiliate commision of shipping...

Posted: Fri Jul 01, 2011 4:50 pm
by SXGuy
perhaps not a bug, just a misunderstanding on how comission is calculated. Tromas, set up an affiliate account and see if the % of comission recieved is relative to the product price and not the total including shipping.

Re: Affiliate commision of shipping...

Posted: Sun Jul 03, 2011 2:30 am
by Tromas
SXGuy wrote:perhaps not a bug, just a misunderstanding on how comission is calculated. Tromas, set up an affiliate account and see if the % of comission recieved is relative to the product price and not the total including shipping.
I did set the affiliate commission to 10%.
Registered an affiliate account, and followed the link.

Products bought: $90
Shipping: $10
Total: $100
Affiliate commission: $10


Anywhere I can make changes, so that commission is only being paid of products bought and not the shipping cost?

Re: Affiliate commision of shipping...

Posted: Sun Jul 03, 2011 4:46 am
by grgr
You can give this a go...

Edit ../catalog/controller/checkout/confirm.php

change:

Code: Select all

				if ($affiliate_info) {
					$data['affiliate_id'] = $affiliate_info['affiliate_id']; 
					$data['commission'] = ($total / 100) * $affiliate_info['commission']; 


to:

Code: Select all

				$subtotal = $this->cart->getSubTotal();
				
				if ($affiliate_info) {
					$data['affiliate_id'] = $affiliate_info['affiliate_id']; 
					$data['commission'] = ($subtotal / 100) * $affiliate_info['commission']; 


Re: Affiliate commision of shipping...

Posted: Sun Jul 03, 2011 5:24 am
by Tromas
:joker:

That seems to work!!

Thanks so much. Couldn't figure out this by myself!

Re: Affiliate commision of shipping...

Posted: Wed Jan 18, 2012 2:45 am
by matts118
Hi.

This works great, but could somebody also please tell me how to also minus any coupons from the amount calculated for the affiliate. I have been trying for ages, but don't seem to be able to do it.

Many Thanks

Re: Affiliate commision of shipping...

Posted: Wed Jan 25, 2012 5:04 am
by cyansnow
Did anyone come up with an answer to the coupons question ..... i am also needing to do this, and i cant find it either

Good fix for the shipping

Thanks so much

Re: Affiliate commision of shipping...

Posted: Thu Feb 23, 2012 2:29 am
by thehoneyjar
Thanks! This is just what I needed! So grateful to the Opencart community!

Re: Affiliate commision of shipping...

Posted: Tue May 15, 2012 2:44 am
by naturesfootprint
Any solution to the coupon problem?

Re: Affiliate commision of shipping...

Posted: Wed Aug 01, 2012 5:30 pm
by cocooner
what is the difference between this solution and following vQmod?

http://www.opencart.com/index.php?route ... e=0&page=7

It seems that vQmod is someting wrong to me...

Re: Affiliate commision of shipping...

Posted: Thu Aug 02, 2012 12:21 pm
by grduniam
Hi Cocooner,

There was a difference with the Vqmod and because of it, it only seemed to work with version 1.5.2.1 and below. Now I've updated the Vqmod to what is specified in this thread and it now is working with 1.5.2.1 and 1.5.3+.

So now, there is nothing different to the solution in this thread and the vqmod: http://www.opencart.com/index.php?route ... on_id=6690

Please let me know if you have any issues.

Re: Affiliate commision of shipping...

Posted: Sat Nov 10, 2012 8:46 pm
by Astron
This works fine at the front end. It doesn't work at the admin panel, any ideas on how to make it work from the admin panel?

Re: Affiliate commision of shipping...

Posted: Sun Nov 11, 2012 12:32 pm
by ChadRogers
Hi,

Do you guys have an update if this works for version 1.5.4.1?

Having a hard time here.
Thanks

Re: Affiliate commision of shipping...

Posted: Mon Nov 12, 2012 4:10 pm
by ChadRogers
grgr wrote:You can give this a go...

Edit ../catalog/controller/checkout/confirm.php

change:

Code: Select all

				if ($affiliate_info) {
					$data['affiliate_id'] = $affiliate_info['affiliate_id']; 
					$data['commission'] = ($total / 100) * $affiliate_info['commission']; 


to:

Code: Select all

				$subtotal = $this->cart->getSubTotal();
				
				if ($affiliate_info) {
					$data['affiliate_id'] = $affiliate_info['affiliate_id']; 
					$data['commission'] = ($subtotal / 100) * $affiliate_info['commission']; 

Hi,
Please help me out. Is this applicable to v1.5.4.1? it my file seems to have that already but its still not working... Is there something that I have to change on the back office of opencart?

Re: Affiliate commision of shipping...

Posted: Mon Nov 12, 2012 5:07 pm
by grgr
1.5.4 already has this fixed as you have seen and mentioned. Not sure what isn't working for you, it's a fairly simple sum: (subtotal/100) x commision rate. There's not really a lot to 'not work'.

Re: Affiliate commision of shipping...

Posted: Wed Nov 14, 2012 6:23 pm
by ChadRogers
grgr wrote:1.5.4 already has this fixed as you have seen and mentioned. Not sure what isn't working for you, it's a fairly simple sum: (subtotal/100) x commision rate. There's not really a lot to 'not work'.
Hi,

Thank you for your response,

That's what I'm saying, I already did that but it still is computing the shipping on the affiliate commission..

Re: Affiliate commision of shipping...

Posted: Wed Nov 14, 2012 6:58 pm
by ChadRogers
Here is an attached copy of my php file..

It's still now working.. shipping is still in the computation

Re: Affiliate commision of shipping...

Posted: Wed Nov 14, 2012 7:27 pm
by ocmta
Make sure that Shipping has higher Sort Order in Order Totals than Sub Total (so Sub Total doesn't include Shipping). E.g. Sub Total should have Sort Order set to 1, and Shipping should have Sort Order set to 2.

Re: Affiliate commision of shipping...

Posted: Tue Feb 12, 2013 11:24 pm
by im4dlaw
Has this ever been solved? I have fresh install of OC 1.5.4 WITH settings mentioned above already in code by default as well as the orders set properly and it is still including shipping on affiliate commission..