Tiers Rates & Wholesale price

Hey I need to have a 7.5% & 2.5% commission for the tier rates. Right now, when I use 0.075 it erases the 5 at the end and only uses the 0.075, is there a way to change this to actually have the discount.

Also, is there a way that the commission can be taken of another price than the one they’re buying form. For example, what my client wants is to have the commission base on wholesale price and not the online retail price is on the website?

Thanks for your help

3 Responses to Tiers Rates & Wholesale price

  1. George June 12, 2017 at 7:22 am #

    Sorry this was a typo from my side.
    I’ve edited the comment to correct this. Probably this is the reason it doesn’t work.
    Please try again.

    add_filter( ‘affiliates_referral_amount_decimals’, ‘affiliates_change_decimals_example’ );
    function affiliates_change_decimals_example( $decimals ) {
    return 5; // 5 decimals instead of 2 used by default
    }

    Cheers,
    George

  2. Oscar June 7, 2017 at 8:53 pm #

    Hey George,

    I did what you say and I added the code in the functions.php and I also alter the table but still doesn’t work, as everytime I tried when I save it erases the last number. Are you sure that works? Also why they’re two add_filter exactly the same.

    Thanks for your help.

  3. George June 6, 2017 at 10:41 am #

    Hi Oscar,

    Please have a look at the following guide on how to set 5 decimals:
    Before you modify your functions.php and the database with the following query, make sure to make a full backup of your site and database. You should also test this on a staging site before using it on your production site.
    The following example function can be used to modify the number of decimals used for referral amounts. You can put this in your functions.php:
    add_filter( ‘affiliates_referral_amount_decimals’, ‘affiliates_change_decimals_example’ );
    function affiliates_change_decimals_example( $decimals ) {
    return 5; // 5 decimals instead of 2 used by default
    }

    You must also change the database type of the column ‘amount’ in the ‘wp_aff_referrals’ table (here using the default ‘wp’ as prefix in the WordPress database tables).
    To modify the column ‘amount’ from MySQL use the query:
    ALTER TABLE wp_aff_referrals MODIFY amount DECIMAL (18,5);

    Regarding wholesale prices, this is not possible because the referral amount calculation is based on the price of the product in the order.

    Kind regards,
    George

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share