How to round price to 99 cents
Open your current wp theme functions.php file and drop there next code:
add_filter('woocs_raw_woocommerce_price', function($price) {
return round($price + 0.01) – 0.01;
});
Also you can do manipulations for selected currencies using IF:
add_filter('woocs_raw_woocommerce_price', function ($price) {
global $WOOCS;
if ($WOOCS->current_currency === 'USD') {
$price = round($price + 0.01) - 0.01;
}
/*
if ($WOOCS->current_currency !== 'EUR') {
$price = round($price + 0.01) - 0.01;
}
*
*/
return $price;
});
Read also: https://currency-switcher.com/hook/woocs_raw_woocommerce_price/ + https://currency-switcher.com/woocs_woocommerce_variation_prices
Origin: https://wordpress.org/support/topic/round-price-xx-99/
