Your cart is currently empty!
Tiers Rates & Wholesale price
—
by
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
Posted in Affiliates by Username
Comments
3 responses to “Tiers Rates & Wholesale price”
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
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.
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