WooCommerce – Disply prices with two decimal zeroes as (,-) instead of (,00)

I had a project, where prices had to be displayed with ,- instead of two decimal zeroes ,00. (99,- instead of 99,00).

In WooCommerce you can do this really simple.

Just put this code in your 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');
ms@morningtrain.dk'

Martin Schadegg Rasch Jensen