Why does my stock revert back to zero if I use the “Add stock” feature?

Top WooCommerce & WordPress Plugins Forums Cost of Goods for WooCommerce Why does my stock revert back to zero if I use the “Add stock” feature?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #90025
    Leanne
    Guest

    Hi, when I add stock it reverts back to 0 after some time.

    I sold some products so it should have decreased, but I did not sell out (and stock numbers were properly added and accounted for), so there should still be some stock.

    This only happens on items where I’ve added additional stock utilizing the Add Stock feature.

    #90026
    Pablo
    Moderator
    Plugin Support

    Hi Leanne,

    We have been using the wc_update_product_stock() function to update the stock. Now I realized it was updating the _stock meta in the database with a float number and not with an integer, and that was causing some issues with the stock calculation when products were purchased.

    This is a function from WooCommerce itself. I don’t know why it works like that. Anyway, I’ve modified the plugin to fix this. Please update the plugin to version 2.6.0 and let me know if it works better now.

    #90027
    Leanne
    Guest

    Thanks! I updated the plugin. It looks like it won’t write over unless I uncheck the sync with Square. Have done that and it’s updated. Will check if it stays updated after making another sale.

    #90028
    Pablo
    Moderator
    Plugin Support

    Hi Leanne,

    I’m not sure if I got your point. Anyway, it seems that it’s working now. Let me know if you need more help.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.