Remove zero decimals in product price

Under General Settings in WooCommerce Settings screen, you will find options to set your store Currency, Currency position, Decimal separator and Number of decimals for your store. Here Number of decimals allows you to Choose the number of digits to appear after the decimal separator.

Based on selected option, it will display prices through out your website with decimals (like $ 121.00). In order to remove decimals from displaying in your product price, add below code in functions.php file of your website theme.

add_filter( ‘woocommerce_price_trim_zeros’, ‘__return_true’ );

Leave a Reply

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