Product with Variation shows out of stock
-
This isn’t anything I need help with, more how I fixed it.
So the issue that caused it for me was two things. One is I made a simple product a variable product. This confused the heck out of woocommerce and it sets the parent as “out of stock” even though the variations are all in stock. The other is the theme I am using seemed to do it for random products as well. The theme developers said it was a bug and to delete the products and redo them (nice cop out). I tried using YITH bulk editor to edit the parent, exporting products and importing to over ride, nothing would change it. So I had to do SQL commands in phpmyadmin on the database so I didn’t have to delete the product and do it over again (it effected about 50 products for me).
Please make a backup of your database prior to running.
UPDATE
wp_postmeta
SETmeta_value
= ‘instock’ WHEREwp_postmeta
.post_id
= 13490 ANDmeta_key
= ‘_stock_status’;
SELECT * FROMwp_postmeta
WHEREpost_id
= 13490 ANDmeta_key
= ‘_stock_status’So this updates the meta value of the postmeta table → post ID (found in the URL of editing the product) where the meta key is _stock_status. Just change that post ID with each product you need. The second line just selects and shows me that it changed.
Hope it helps!
- The topic ‘Product with Variation shows out of stock’ is closed to new replies.