Forums
(@rbnmo)
4 years, 4 months ago
I found out the issue. It was because the product is a variable product but has no variations.
Tried it and it still doesn’t work:
$new_stock = wc_update_product_stock($post_id, $qty, 'set', false); wc_delete_product_transients($post_id);
I see this: Out of stock (8) Out of stock (3) etc..
Thank you very much, lorro! I will try that and get back to you if it doesn’t work.