• Resolved brunofesta

    (@brunofesta)


    all of a sudden my woocommerce variable stock quantities have 7 decimal places.
    eg: Stock numbers 2.0000000

    I can;t figure out why or how to fix this.
    There are forums with code to enable decimals in stock quantity but it hasn’t helped.

    Have woopos pro and have directed questions there but they weren’t able to solve

    https://www.ads-software.com/plugins/woocommerce/

Viewing 12 replies - 1 through 12 (of 12 total)
  • I’m having the same issue.

    The “Stock Qty” input field adds a bunch of decimal places after I input my single number and then update the product. It seems that stock quantity then doesn’t get reflected on the front end when selecting a variation… strange.

    Thread Starter brunofesta

    (@brunofesta)

    I did some troubleshooting yesterday.
    Installed woocommerce on another wordpress install. Disabled all plug ins and only activated woocommerce. Created a dummy variable product and found the stock number issue existed.
    Seven decimal places. This rules out a plug in causing the fault or woocommerce being corrupt.
    I think it is a woocommerce issue post the last update

    What browser are you using? I am using Firefox and although when I inspect the element the value is 6.000000 in the browser it shows 6.

    Thread Starter brunofesta

    (@brunofesta)

    Hey I just looked with Firefox and the stock numbers are there without the decimals.
    So it is a Chrome issue!
    Thanks.

    Looks like the latest WooCommerce 2.4.2 release resolved the issue.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Where are you seeing this? Stock values are cast to integers unless you’re running a plugin which adds decimal support, in which case its floats and floats could be output like that.

    Thread Starter brunofesta

    (@brunofesta)

    We figured out this issue only occurs when using Chrome the stock quantity number in a variable product appears as follows
    2.0000000

    It doesn’t affect the front end though.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Can you screenshot where you are seeing this?

    Thread Starter brunofesta

    (@brunofesta)

    It was in Stock quantity in product variations but the latest woocommerce update has fixed it.

    This can be resolve by editing the woocommerce plugin.

    edit the file “/wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-variation-admin.php” on line 115 replace the
    echo esc_attr( $_stock );
    to
    echo esc_attr( number_format($_stock , 0, ‘.’, ”));

    Hi pienavs, tried your fix and did not work unfortunately.

    We updated Woocommerce to the latest version this morning in the hope that it was purely a bug. Seems like it was not.

    Unlike brunofesta problem our products are not variable but simple products. Tried on different browsers each with the same result unfortunately. This only started happening a few weeks ago when we decided that we are long overdue for a woocommerce update.

    The problem varies though, most products display the stock qty correctly on the thumbnail preview. If you do go the product the stock quantity do not show the trailing decimal zeros. (see screen shot)

    Please assist?

    Screenshot 1
    Screenshot 2

    Website

    Have upgraded to the latest version of WP and can report it is still doing it with vanilla WooCommerce.

    We are actually updating our stock-list with smart manager, which stops the decimal point error (seems it is a problem with the standard variations wuantities page).

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘stock quantities now have 7 decimal places!!!’ is closed to new replies.