Skip to content

Instantly share code, notes, and snippets.

@frankschrijvers
Created March 2, 2016 15:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save frankschrijvers/7e3b647057366a67da7e to your computer and use it in GitHub Desktop.
Save frankschrijvers/7e3b647057366a67da7e to your computer and use it in GitHub Desktop.
How to hide trailing zeros on prices in WooCommerce
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
// Hide trailing zeros on prices.
add_filter( 'woocommerce_price_trim_zeros', 'wc_hide_trailing_zeros', 10, 1 );
function wc_hide_trailing_zeros( $trim ) {
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment