My goal is to display prices with two decimal zeroes as (,-
) instead of (,00
) for the Kr currency.
So far I’ve used the following method.
Just put this code in the theme’s functions.php file:
function remove_zeroes_from_price($price) {
$price = str_replace(',00', ',-', $price);
return $price;
}
add_filter('woocommerce_get_price_html', 'remove_zeroes_from_price');
and it works in all places except the amount spot and checkout pages. Does anyone have another method to apply this throughout the entire website?
I figured out the solution please see what i used below