Remove Trailing Zeros on Woocommerce Prices

Aug 18, 2020 | WooCommerce, Wordpress

Want to get rid of those annoying zeros after the decimal place on your website? Fortunately it’s nice and easy!

Simply open up your theme functions.php file, and add the following to the end.

// REMOVE TRAILING ZEROS ON PRICES
add_filter( 'woocommerce_price_trim_zeros', 'joy_hide_trailing_zeros', 10, 1 );
function joy_hide_trailing_zeros( $trim ) {
    return true;
}

Did you find this helpful? Do you have any questions? We’d love to hear from you – drop us a comment below.

Browse More Hints & Tips

Remove ‘Projects’ post type in Divi

Remove ‘Projects’ post type in Divi

Divi is great, but you don't always need all the features. I often find myself not using the "Projects" post type, and prefer to hide it to keep the back end simple for my clients. It's easy to do, just add the following code to the end of your functions.php file: //...

Remove Website URL Field from WordPress Comment Form

Remove Website URL Field from WordPress Comment Form

Making your website easy to use is important, so I like to remove unnecessary fields from forms - that way, it's easier for people to get in touch with you. One of those annoying fields is the "Website URL" field in the Wordpress Comment form. It is also often used...

0 Comments

Submit a Comment

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