How to setup commission based on purchase order total? (Cont’)

Hi I have done the recommendation.

So we have set up the following.

B referred by A to the system
B referred an order to the system

So we setup the below:

if ($variables[’s’] >= 12800) {

$variables[’or’] = 1400;
$variables[’l1’] = 250;

} elseif ($variables[’s’] >= 9800 && $variables[’s’] = 6800 && $variables[’s’] = 3800 && $variables[’s’] = 9800 && $variables[’s’] < 12800) {

$variables[’or’] = 1050;
$variables[’l1’] = 200;

But we only can get the 1050 calculated, and not the l1 “200”

Could you help to see anything else can be fixed?


Comments

12 responses to “How to setup commission based on purchase order total? (Cont’)”

  1. Hi Alex,

    Thanks for providing access to your site and custom formula. As it seems there is an issue with formulas and tiered commissions which we have spotted because of your case and we will issue an update for Affiliates Enterprise plugin including a fix for this.
    Thanks for your cooperation.

    Kind regards,
    George

  2. Hi Alex,

    Yes I did, thanks. Once I have an update I’ll follow-up to this thread.

    Cheers

  3. Alex Lee Avatar

    Hi George,

    My colleague sent email to you, did you get it?

  4. Hi Alex,

    Can you please forward me a copy of the snippet you use to george at itthinx dot com, alongside with the detailed description of the different rates you wish to use.

    Kind regards,
    George

  5. Alex Lee Avatar

    Hi George,

    I created 2 rates:
    – Rate 1: type is formula, value is or, level is empty
    – Rate 2: type is formula, value is l1, level is 1

    I created a little plugin to hook the affiliates_formula_computer_variables filter:
    – if total order >= 12800, commission for OR is 1400, commission for Level 1 is 250
    – if total order from 9800 to 12799, commission for OR is 1050, commission for Level 1 is 200

    Not sure if it is correct. Can you help?

  6. Hi Alex,

    The values you currently use for your rates are valid only if you’re using a custom formula and have defined them in the formula snippet, otherwise the rates used will fail and you will have errors on your site. FYI, the hook used for custom formulas is affiliates_formula_computer_variables
    Can you please share what is your main goal for rates?

    Kind regards,
    George

  7. Hi Alex,

    Thanks for that, please make sure that you have also installed the custom formula snippet because I can’t find it anywhere on your site.

    Kind regards,
    George

    1. Alex Lee Avatar

      Hi George,

      Where can i find the “custom formula snippet”?

  8. Alex Lee Avatar

    Hi George,

    I just created an admin account for you at: https://skinic.aboutknowledge.com/

  9. Hi Alex,

    Thanks for sharing but this screenshot is from the custom formula, what about the rates set under Affiliates > Rates?
    Furthermore, the line you added above is wrong and I’m referring to this part:
    } elseif ($variables['s'] >= 9800 && $variables['s'] = 6800 && $variables['s'] = 3800 && $variables['s'] = 9800 && $variables['s'] < 12800) {
    and if you’re using it inside the snippet I provided then it definitely won’t work.

    Can I please have a look at your back-end? You may provide temp admin credentials using my personal email for this account, george at itthinx dot com. Also, please make sure to use the snippet that I provided as is.

    Kind regards,
    George

  10. Alex Lee Avatar

    Hi,

    I attached the setting in this link: https://drive.google.com/file/d/1DgCrvwCyzZqgQjIr2hpm1TU9c2HlLkHB/view?usp=sharing

    Can you check?

  11. Hi Alex, welcome back to our support forum.

    Does the snippet above come from the addon I’ve sent you or is it an extra addition you have used? Also, can you please share the rates you’re currently using? Have you set a rate for tiered commissions?

    Kind regards,
    George

Share