WordPress

How to Show Trailing Zeros on Prices in WooCommerce

WooCommerce trailing zeros

If you are looking to add trailing zeros to your WooCommerce prices then there is a plugin for this, but I have created a simple code snippet that shows trailing zeros on prices in WooCommerce.

All you have to do is just to add this code in your theme’s functions.php file.


add_filter( 'woocommerce_price_try_zeros', 'wc_hide_trailing_zero', 10, 1 );
function wc_hide_trailing_zero( $try ) {
// set to false to show trailing zero
return false;
}

Related posts

40+ Best Free WordPress Themes for 2019

WPITECH

How to Create Gutenberg Block Templates in WordPress

WPITECH

How to Remove Author Name from WordPress Posts

WPITECH