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

0 Comments

Submit a Comment

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