The deal is, I have to fix an error in a custom WooCommerce import plugin, which appeared after updating WC from 2.6 to 3.4.
It uses the 'wc_update_product_stock_status' function, and used to pass post (product) id and it's stock status as it is represented in DB ('instock' and 'outofstock', as a string). But nowadays, as I can see in the WooCommerce docs (https://docs.woocommerce.com/wc-apidocs/function-wc_update_product_stock_status.html) it accepts integer instead of string.
So, the question is - what are those integers for in/out of stock values (1/0 did not fit).
If you look to the source code in
wc_update_product_stock_status()
function:It uses the
WC_Product
set_stock_status()
Woocommerce 3 CRUD method which uses strings But not integers values:It still uses:
'instock'
and'outofstock'
status strings. the default value is'instock'
…Before Woocommerce 3, stock status was handled as product meta data.