Your cart is currently empty!
Cannot set rate past 2 decimal places
—
by
I am trying to set a rate of 0.095 (9.5%), however, when I do this and save the setting, affiliates pro starts calculating the rate as if it were 9%, which is wrong. What is the fix for this?
Posted in Affiliates Pro
Comments
3 responses to “Cannot set rate past 2 decimal places”
Perfect!!
Hi George,
This has solved my issue.
Thank you
Mat
Hi Mathew,
Regarding decimals, you need to use the following snippet in your functions.php file of your theme.
function affiliates_change_decimals_example( $decimals, $context ) {
if ( $context === 'display' ) {
$decimals = 2;
} else {
$decimals = 3;
}
return $decimals;
}
add_filter(
'affiliates_referral_amount_decimals',
'affiliates_change_decimals_example'
);
this snippet will use 2 decimals for displaying and 3 for calculations. The detailed description for the filter
affiliates_referral_amount_decimals
can be found here.Kind regards,
George