WooCommerce zero trimming decimal

I found this little neat thing when messing around with decimals in WooCommerce.

// Trim only when decimal is zero in price
add_filter( 'woocommerce_price_trim_zeros', '__return_true' );

Nice of them to provide this little filter! But even better if it was a setting in wp-admin, but until that is added, this is a quite simple solution. Just put the above code in your functions.php.

If you can’t access your functions.php or don’t know howto do it, there is of course a plugin for that. It’s made by Therichpost, and it only does exactly the above small filter snippet above. So really simple and not bloated with other crap 😉

Leave a comment

Your email address will not be published. Required fields are marked *