Home › Forums › Cost of Goods for WooCommerce › Why does my stock revert back to zero if I use the “Add stock” feature? › Reply To: Why does my stock revert back to zero if I use the “Add stock” feature?
June 14, 2022 at 2:58 am #90026
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.