Price decimals numbers - by santo21 - on WordPress WooCommerce support

This topic has 4 replies, 3 voices, and was last updated 10 years ago ago by Stan Russell

  • Avatar: santo21
    santo21
    Participant
    December 10, 2015 at 05:43

    Hello,

    1. Is it posible to have the font of the two decimals in the prices smaller on the single product page?
    As an exemple: for 38,99 to have the ,99 smaller and placed upper.

    2. How can I make the trailing zeros not show on the single product page? If I have a price like 29,00 I don’t want the ,00 to show up.
    I tried to put 0 decimals in the whoocommerce setings but this makes the VAT wrong on the check-out page. The VAT should have the 2 decimals.

    Thank you.

    3 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    December 10, 2015 at 08:27

    Hello,

    1. Unfortunately there is no such possibility.

    2. I’ve added this code in functions.php file to hide trailing zeros:

    // 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 true;
    }

    Please check prices now.

    Best regards,
    Jack Richardson.

    Avatar: santo21
    santo21
    Participant
    December 10, 2015 at 12:53

    Just want I wanted! Thank you!

    Avatar: stan
    Stan Russell
    Participant
    December 10, 2015 at 13:58

    Hello santo21,

    you are welcome!

    Regards,
    Stan Russell.

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘Price decimals numbers’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.