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

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #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 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.