Closed odirlon closed 4 years ago
Completing post:
The only thing that resolves is the update of the product, change of the volume in stock of the variation or in the last cases recadastro of the product.
i am getting the exact same error. @odirlon did you find any solution?
Not yet, unfortunately.
In your case, are all variations priced?
@odirlon Yes. All variations are priced.
I have the same problem. All products in my shop are variation products and since lasts updates i'm getting this same problem.
I have detected it happens when someone buys in my shop.
When someone buys, a random product of my shop instantly chages to "Out of stock"
Follow this!
Same problem. Disabled all plugs but woo, switched theme, even rolled back to woo 3.6.8 - no improvement. Only restoring from point in time backup fixed it indicating problem is in database.
Hey gay! try this: Go to Products > All > Kick Edit
Change the "Stock status" for "In Stock".
@ivanodonoghue, Anyway, this is not problem solving, this is palliative. I have not yet discovered the source of the problem.
I had a backup with 3.5.8. Happened just once, but I'm not sure if it's the same problem. If u can move to this version just do it while someone fixes this bug
@dnavarroBIG simply replacing 3.6.x with 3.5.8 version of plugin didn't work for me, I needed to do a full restore, indicating that the database has a part to play.
I am able to fix individual products manually by disabling stock management for each variation, saving the changes, then re-enabling stock management and saving the changes again.
The issue as I see it is that, in situations where the stock display on the front end is incorrect, the wc_product_meta_lookup (which is used to build the front end display of the product) is incorrect and doesn't reflect the data in the postmeta table unless you follow these steps. Simply clearing that table and regenerating the data doesn't make any difference.
Hello @millionleaves!
I am able to fix individual products manually by disabling stock management for each variation, saving the changes, then re-enabling stock management and saving the changes again.
R: I do the same and also fixes the problem. Another solution is to add a drive in the variations, save and then subtract the added drive and save again, also resolves.
The issue as I see it is that, in situations where the stock display on the front end is incorrect, the wc_product_meta_lookup (which is used to build the front end display of the product) is incorrect and doesn't reflect the data in the postmeta table unless you follow these steps. Simply clearing that table and regenerating the data doesn't make any difference.
R: Yes, All the tricks like recalculating the terms, generating the table, or clearing client sessions does nothing.
The most bizarre of all is that this is happening in several clients, with different situations, plugins, hosting, etc ...
I want to add another issue we noticed regarding this out-of-stock problem. The issued archive pages in our case had wrong classes added to the
see pic:Guys, I created a page to punitor the products that have this problem.
What's the downside: A public page will be created with all the products of your ecommerce, I recommend creating a very complex link and disable the indexing of thefts.
Let's take the steps:
01- Create a page-checkstock.php with the following code: https://github.com/odirlon/checkstock-error
02- Change the line 84 to receive the notifications.
03- Create a page with a complicated slug like this: "check-stock-2452233213321653441" and use the template created in the previous step.
04- Create a cron to check the page from time to time on the site: https://www.easycron.com/user
05- Ready, now whenever a stock bugar you will receive an email notifying you, or if you want to see if the site has an error simply access the page you created.
Remember to remove the cache from this page.
Hello guys,
Anyone know if the issue has been resolved in the new update? 3.6.4
This is a big problem for anyone who manages 50 more customer shops.
Thank you very much!
@odirlon Looking at my postmeta table in the database, I've realised that some of my products have _manage_stock set to 1/0 rather than yes/no. I don't know how they got like that, but these are the products that are causing the issue - when I fix them as described in my earlier comment, it sets them to yes and the issue goes away.
So ... either there is something wrong with my site, or there is a specific historical reason they are like that that the latest version of WooCommerce doesn't take account of when building the wc_product_meta_lookup table.
I believe this is related to the way the product is being setup.
From the research I've done, if you create a product as a standard product and save it, and then change it to a variable product it seems to be creating this issue. I've had this on more than one site.
Thanks @connexgroup. That makes sense, based on the site I'm thinking of. This issue feels like something that should be dealt with in WooCommerce core through a bug fix, but at least I now know I fix it myself by running a database update on any sites exhibiting this issue.
Hey! Cool this, I'm excited now! I'll do simulations to see this happen.
Hi guys,
This here solved for me: https://wordpress.org/support/topic/variable-product-display-as-out-of-stock-when-there-is-stock/#post-11584624
a practical and fast solution to solve all the products in one go. then we should not have any more problems! Thank you so much!
Looks like this was addressed by #23534, and a workaround for stores who already have updated lookup tables when the bug was present is to regenerate them again by WooCommerce > Status > Tools and regenerating product lookup tables (note: this might take some time depending upon the number of products in the store)_. I am closing the issue, but please comment if this is still happening with the latest version and I will reopen it again.
I had the same problem. What I did to fix it was bulk edit the products and even tho they said out of stock I selected out of stock and hit update. After that I bulk edited again and set them to in stock. It worked for me 👍
I'm running into this issue too (products with in stock variations aren't showing in search or catalog when "Hide out of stock items from the catalog" is enabled) on a site with 8k+ products with variations running into the 50k+ territory. Completely wiping wc_product_meta_lookup and running regenerate Product lookup tables doesn't fix.
Are there any other hooks I could run to update product data? Strangely, I can fix an individual product by flipping the Product data dropdown to "Simple product", going to Inventory, changing Stock status to "out of stock", changing the dropdown back to Variable product, and hitting Update. Doing that for 8,000 products isn't really feasible however.
Describe the bug I have long been noticing that some products are shown as stock out of stock even though it is perfectly configured. Sometimes it is enough to update the product (without changing anything in it, just opening the product and clicking on update) it already leaves the message "out of stock", other times it is necessary to add an additional item in some variation, to update the product and then remove the item added to the out-of-stock message exit.
I ended up thinking that it could be a bug of my theme, however the message is in the admin panel as well as can be checked in the prints.
But on the product screen the purchase is carried out quietly, this message does not stop the purchase, but leaves the thing a little confused.
Screenshots (Admin - Listagem de produtos):
(Admin - abas do produto):
(Front - Listagem de produtos):
Expected behavior I believe that the normal behavior was to know that the product has stock, and not to display that message.
Isolating the problem (mark completed items with an [x]):
WordPress Environment