WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Decimals not working at price (8 posts)

  1. manfredschmutz
    Member
    Posted 6 months ago #

    Hi
    I have set 2 decimals in the settings to display the price. But the settings are not working, because the price is always shown without decimals.
    It looks like the method wc_price() is always returning the price without the correct amount of decimals set in the settings.

    the url of the site is: http://www.kdm-edelsteine.ch

    Thanks in advance for your help

    https://wordpress.org/plugins/woocommerce/

  2. PhaseCreative
    Member
    Posted 6 months ago #

    I am also having this problem. Is there a known fix for it yet?

    Thank you.

  3. tesser00
    Member
    Posted 6 months ago #

    I have the same problem but only if the price are with two zero after comma.
    Example:
    32,00 --> 32
    32,99 --> 32,99

    Olso in the product administration (list) the price are without ,00.

    I have woocommerce 2.1.2 and WP 3.8.1

    My Catalog page: http://www.funtasticschool.it/shop/

    Sergio

  4. manfredschmutz
    Member
    Posted 6 months ago #

    Hi

    Try the solution described in this topic: http://wordpress.org/support/topic/where-are-the-decimals

    it helped me to solve the problem

    Cheers

    Manfred

  5. Coen Jacobs
    Member
    Plugin Author

    Posted 6 months ago #

    In WooCommerce 2.1.3 this will default to show the zeros after the comma again.

    We've made this change, but will revert it in the next fix release.

    To fix it now, use this code (it will be forward compatible with our fix):

    add_filter( 'woocommerce_price_trim_zeros', '__return_false' );

  6. feuerkralle
    Member
    Posted 6 months ago #

    Hello Everybody!
    Related to this topic i have an additional problem with price formatting:
    In the currency settings the seperator for decimal and thousands doesn't work:

    My Settings:
    Seperator für thousands: .
    Seperator für decimal: ,

    But the result is i.e. 36.00 instead of 36,00

    Will this problem fixed with the next release too?

  7. lucawater
    Member
    Posted 2 months ago #

    I added "add_filter( 'woocommerce_price_trim_zeros', '__return_false' );" to my functions.php file, but i'm still not seeing the zeros

  8. lucawater
    Member
    Posted 2 months ago #

    The only place where the price is displayed properly is at cart content(so with: "$woocommerce->cart->get_cart_total();").

    None of the settings seem to apply to the other price. My settings are:
    Thousand seperator: .
    Decimal seperator: ,
    Number of decimals: 2

    When I fill in 5,95 as price, it returns "5.95"(so with a dot instead of comma)
    when I fill in 5 as price, it returns "5"(so without the comma and two zeros)

Reply

You must log in to post.

About this Plugin

About this Topic