WPITECH
Image default
WooCommerce

How to Show Trailing Zeros on Prices in WooCommerce

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

How to Change WooCommerce Payment Status for Prepaid Orders

WPITECH

Change Link “Add to Cart” for a Link to the Product in WooCommerce

WPITECH

Show Category in WooCommerce Product Loop

WPITECH