One of the changes that was made with the refinement of the WooCommerce Settings in WooCommerce 2.1 was the removal of the option to show trailing zeros after prices.
Pre WooCommerce 2.1 there was a checkbox you could check to show the prices with trailing zeros, this was removed and replaced with a filter instead.
In order to display trailing zeros on your prices add the code below to your theme’s functions.php file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Show trailing zeros on prices, default is to hide it. | |
add_filter( 'woocommerce_price_trim_zeros', 'wc_hide_trailing_zeros', 10, 1 ); | |
function wc_hide_trailing_zeros( $trim ) { | |
// set to false to show trailing zeros | |
return false; | |
} | |
?> |
I’ve tried using this with the latest version of WP / Ecommerce and it not longer works. Can you please help?
Hi, i try to find out how i set price 0 (zero ) we wold not have price oly order product.
Pls help.
0 Pingbacks