Woocommerce Ref-Commission “baseable” on amount instead of price?

Hi guys,

I got the affiliate enterprise package and everything works perfectly.

The only thing is, that I need to base the affiliate woocommerce commission-rates on the amount of items the referral bought, not on the price-sum of the sale.

I tried to use a custom referral amount method but the parameters, which I can use with it, are just returning the base_amount and no commission-rates of the different levels, the price-per-item let alone the sold amount of items.

There is also a $parameters[’data’], which should return the referral-data in an array, but I do not know, what kind of data is returned in this array. (maybe the ones I need above?)

Or is there another, easier method, which I just overlooked.

Thank you very much for your help in advance.

Best Wishes,
Johnny


Comments

6 responses to “Woocommerce Ref-Commission “baseable” on amount instead of price?”

  1. That’s great!

    Cheers,
    George

  2. Hi Johnny,

    Perhaps Affiliates Rankings is not very relevant with your case, but how would you calculate commissions according to product amounts in the order? The commission would be a fixed amount depending on the products bought or a rate that will be calculated according to the product price?
    If you use a custom referral amount method you can check the amount of products in the order, but what would be the commission?
    In the example for the custom method, you can retrieve the order id with $parameters[‘post_id’]. If this id is from a valid order, then you can get the amount of products bought using WC API methods.

    Kind regards,
    George

    1. Johnny Homy Avatar
      Johnny Homy

      Hi George,

      thanks for the feedback. I solved it by calculating back the ordered amount based on the sum total of the purchase and then calculating the commission. (sumtotal / procuct price)*commission rate. Easy cheasy. 😉

      This proved to be the simplest and best solution in my case.

      But your method also sounds interesting. I will have a look at it.

      Wishes,
      Johnny

  3. Johnny Homy Avatar
    Johnny Homy

    Hi George,

    I am using affiliates.3.0.1.

    I will have a look at the Affiliate Rankings – addon.

    How can I connect that to the commission – system? (I am using the “Rates” commission-method)

    Can you give me some hints?

    Thank you very much, George.

    Best Wishes,

    Johnny

  4. Hi Johny,

    Which Affiliates version are you using at the moment?
    Please have a look at Affiliates Rankings addon as reference. It counts an affiliate’s referrals and promotes accordingly to a different rank. If you modify this and check the amount of items bought, then you can accomplish your goal.

    Kind regards,
    George

    1. Johnny Homy Avatar
      Johnny Homy

      PS: And I do not need to promote the referrer to a different rank, I just need to calculate his/her Commission on Basis of the amount of sold items:

      E.g.: if the referrer has referred a woocommerce sale of 1000 pieces of this product (at a certain price, of course, but this price is not interesting here), then he/she should get, let’s say 10% of this 1000 pieces as commission. Generally speaking, the commission is not money but it is a certain amount of products.

      The only connection to “ranks” is the different commission percentage of each rank, which needs to be taken into consideration.

      Wishes,
      Johnny

Share