.2525 percent Rate. Is it possible? Need it to be!

Posted in

Hey,
So my client charges $99 for his product and currently pays out %25.25 commission to his affiliates, which equals $24.9975 (rounds up to $25).

I am unable to make .2525 stick in the rates, and it drops it to .25, which changes the commission to $24.75 (a $.25 cent difference).

I know this is a big deal to my client.

Q1: Is there a way to set the Rates option to .2525 and make it stick, OR
Q2: Should I just use Amount for each product (thank gawd he only has 6 products) and make the amount $25?

Thanks!

4 Responses to .2525 percent Rate. Is it possible? Need it to be!

  1. George December 6, 2017 at 9:03 pm #

    Hi David,

    Yes you can use 4 decimals for referral amounts by using the filter affiliates_referral_amount_decimals.
    Before adding this filter though 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.

    You must 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);
    After that place the following snippet on your functions.php file of your active theme.
    function affiliates_change_decimals_example( $decimals ) {
    return 4; // 4 decimals instead of 2 used by default
    }
    add_filter( 'affiliates_referral_amount_decimals', 'affiliates_change_decimals_example' );

    For further info on the snippet or on how to modify the database, feel free to ask here.

    Kind regards,
    George

  2. David December 6, 2017 at 9:16 pm #

    Great. OK, yes. I could use some help with how to modify the database, but I’m confident about how to use the snippet. I will just make a customizations plugin and paste it into there. But could you point me in the direction for how to change the database column amount?

    Thanks!

  3. David December 6, 2017 at 9:44 pm #

    Hi. I think maybe I would do this through PHPMyAdmin, right?
    I locate my database, then select database_aff_referrals.
    From there, I would click Edit, and in the code field, paste:
    ALTER TABLE wp_aff_referrals MODIFY amount DECIMAL (18,5);

    Then click Update.

    After that, I paste the snippet into my functions.php or add it to my customizations plugin.

    Does that sound right to you?

  4. George December 7, 2017 at 11:54 am #

    Hi David,

    Sure no problem.
    After you select your database on phpMyAdmin, click on the wp_aff_referrals table, click on the SQL button on top and execute the query by clicking the Go button.
    Don’t forget to use your table prefix ie if your table prefix is tp then the query should be
    ALTER TABLE tp_aff_referrals MODIFY amount DECIMAL (18,5);
    If the query executed correctly you are ok, otherwise phpMyAdmin will show the error involved.
    I’ve added a screenshot here with the steps involved.

    Once you have completed it, let me know.

    Cheers,
    George

Only authorized members can comment on this topic.

Log in