Closed kaihchan8 closed 7 years ago
On the inventory tab, turn off stock management at product level. You want it to be based on variations instead.
Its definitely still a bug and the inventory tab gets completely ignored despite the suggestions. To fix it you have to delete the product and add it back - making sure that you choose "Variable Product" from the beginning. You can reproduce the problem by adding a simple product and changing it to variable.
@jfksdca If you're referring to the stock status dropdown, variables don't have it because they sync with variations.
Hi, Mike. I see that this was closed sometime ago but my experience was exactly like the others and that was last night. I wasn't referring to the drop down. There is a screen print above that shows a red error "Out of Stock." No matter how I set it up last night the front it displayed that error (I don't think it was really red). That's a big deal because it prevents a user from purchasing the product.
As I understand the system, making it track stock is optional whether its simple or a variable product. "Manage Stock" was turned off and the front end still said "out of stock." The only way I could fix it was to erase the product and start over. I've given steps to reproduce it. Start as a simple product and add a variation. Then change it to variable product and one would see the error. My experience was exactly like the previous reports.
I really believe there is a legitimate issue here that still lingers. If I should start a new threat I could do that. I read through what users were reporting and the responses they got. It always concerns me when support staff try and tell users there is no problem instead of carefully "listening" and trying to reproduce what people are seeing. If 5 people report the same problem then there is either 1) a bug, 2) a lack of documentation on how it works, OR 3) an opportunity to simplify the design/process.
I approach software support from the angle that my job is to ensure the software works. It isn't my job to defend it. No one wins if someone doing support takes the position that the user is wrong. Users get frustrated and switch to a different product and whatever the issue is (usually one of the 3 above) doesn't get addressed.
Start as a simple product and add a variation. Then change it to variable product and one would see the error. My experience was exactly like the previous reports.
Sorry but this is not technically possible. Variations cannot be added to simple products. If you want to show a screencast maybe that will help?
It always concerns me when support staff try and tell users there is no problem instead of carefully "listening" and trying to reproduce what people are seeing.
This is not a support forum, and it's not ran by support staff. There is a helpdesk and forum for that, which you are welcome to post to instead.
We have rules on Github for example, providing steps to reproduce an issue on a clean install. If this is not provided, the issue is closed.
This is not 'defending' or not listening, this for for efficiency. Spending countless hours trying to 'guess' how an issue occurred on a site we cannot access is a waste of time and resources. Following the issue template and prerequisite steps will help avoid having an issue closed without action.
Thanks
I was unclear what your role is on this forum. I'm more than happy to provide you with some screen prints (I'd record video if I still had a Mac but I haven't found an easy way to do that on W10.)
I really, really don't want to be confrontational. I apologize if I sound that way. I am a bit frustrated because I want to help. I would like to request that you please read what I'm saying just a bit more carefully.
It is absolutely true that you can't add a variation to a simple product. BUT you can change the product from simple to variable and then start adding variations. That's where the issue is. Think about it from a database perspective. it makes sense that an issue could occur there because you are adding a relationship to a product and the interface there gets really klugey. I haven't specifically tested this but I think you can get all the way to variations without having hit the save button in the publish section. So the product ID doesn't appear to exist yet to hang those variations off.
That whole section on the bottom really needs to be redesigned. You have tabs across the top, tabs on the left side, variations that can be dragged to reorder and then expand with another 10 fields to input. I would get rid of the tabs and put each tab in sections that stack from top to bottom. It would be more linear and easier to follow. Ideally, questions would guide the user before they make a mistake.
I would appreciate it if you would test this before we do any further. Add a product and complete fields at the top but don't save anything until after you get to simple or variable section. Add a simple product and save it. Test the front end. Looks good but oh you forget there is a flavor. Change it to variable product and add flavor as variation. Don't check the track stock checklist.
(This next part the design sucks because flavor variations are 2 tabs below). Add 2 flavors and test the front end. Is it in stock?
On Mon, Jun 25, 2018 at 3:25 AM Mike Jolley notifications@github.com wrote:
Start as a simple product and add a variation. Then change it to variable product and one would see the error. My experience was exactly like the previous reports.
Sorry but this is not technically possible. Variations cannot be added to simple products. If you want to show a screencast maybe that will help?
It always concerns me when support staff try and tell users there is no problem instead of carefully "listening" and trying to reproduce what people are seeing.
This is not a support forum, and it's not ran by support staff. There is a helpdesk and forum for that, which you are welcome to post to instead.
We have rules on Github for example, providing steps to reproduce an issue on a clean install. If this is not provided, the issue is closed.
This is not 'defending' or not listening, this for for efficiency. Spending countless hours trying to 'guess' how an issue occurred on a site we cannot access is a waste of time and resources. Following the issue template and prerequisite steps will help avoid having an issue closed without action.
Thanks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/woocommerce/woocommerce/issues/16620#issuecomment-399905203, or mute the thread https://github.com/notifications/unsubscribe-auth/AEmnCh46MFGgqoVF9oPwKMAa_Z9TRefUks5uALq3gaJpZM4PEAKf .
Stock management off at the product level but on at the variation level, and this seems to have got it working for me (went from a simple product to a variable).
That whole section on the bottom really needs to be redesigned. You have tabs across the top, tabs on the left side, variations that can be dragged to reorder and then expand with another 10 fields to input. I would get rid of the tabs and put each tab in sections that stack from top to bottom. It would be more linear and easier to follow. Ideally, questions would guide the user before they make a mistake.
It will be. Not a small task though. It's being worked on probably next year. Store on WordPress.com already has some reimagining of the variations with a new UI in react.
Add a product and complete fields at the top but don't save anything until after you get to simple or variable section. Add a simple product and save it. Test the front end. Looks good but oh you forget there is a flavor. Change it to variable product and add flavor as variation. Don't check the track stock checklist.
I see, the box gets toggled on. PR incoming.
I am having the same issue. no matter what I do, it constantly says out of stock for variable product. I've tried adding and deleting the product, no luck. I've tried adding stock for each variation, no luck. It says in stock on the backend product tab.
Oh My
Same issue for me - and so frustrating. No simple answer.
I just dont want Out of Stock to show - and despite having switched it off in main settings and also the product level to test also - same issue.
Why so complicated?
Hello gentlemen.
I assume it might be better to open a new issue here on github if you believe it is a bug, along with steps to reproduce the problem and system status report. Otherwise it's difficult for us to tell if it's related to the original problem raised here some time ago, or how to reproduce the problem.
Alternatively, you can also check for other support channels we provide.
Thx.
I thought i had this problem but it seems I don't... Do the posters above realize you HAVE to set the 'Regular price ($)' for EVERY variation in order for it to work correctly? I have 12 variations and it appeared out of stock despite all the 'stock management' functions deselected. Once i set a price for each variation it worked perfect. http://antiquewoodsllc.com/product/reclaimed-antique-oak/
Please help. I am having the same issue. If I add a product qty without a variation it works fine. If I add a product qty with a variation for different sizes or colors, it works fine. The problem is when I add a variation for FONTS or DESIGNS. I put in the qty in the Inventory tab and not in the variations tab. I can not add a qty in the variations tab because I am wanting to give my customers the option. It will state In Stock for about 10 mins then state Out of Stock. It all started when I changed a simple product to a variation product. If this is a big, what do you suggest I do to fix the problem? I have never done anything like this before. you
Ok so in order for it to work, you have to set a price for each variable. You can also control the inventory by checking the option. https://snag.gy/vUYD9R.jpg
If it can save you time..
Hi magnoliacom. I've watched all the videos and tried that too. Nothing fixed for very long. Only for about 10 mins or less and then I'm out of stock again.
Huh, still working for me.. Will let you know later!
Everything was working fine for me up until I change one of my simple products into a product, instead of deleting it and re-entering it as a variation product. And like I said above I can't the quantities in the variations because my variations are fonts and designs only. Thank you for any and all help that you can provide I'm extremely lost on the subject. I wanted to reach out to you all before I spent a lot of money trying to fix what is hopefully a much more simpler problem.
jwhite0229, if you haven't found a solution, I can take a quick look for you :) If you want to send me access at info@magnoliacom.ca.
I have the same problem in red text 'This product is currently out of stock and unavailable.'
I believe this problem among others happened when I upgraded the woocommerce plug in. Everything was working fine before then.
I went thru the motions of deleting the woocommerce plug in and re-installing and adding 40 products, then deleted the products and currently re-adding them and still no joy. HELP!
It's OK When testing, I didn't specify size when clicking on add to cart button.
Have you set a price for each individual variation? None of them show as in stock unless the price has been set on EVERY variation.
On 6 Jul 2018 02:25, BobRafto notifications@github.com wrote:
I have the same problem in red text 'This product is currently out of stock and unavailable.'
I believe this problem among others happened when I upgraded the woocommerce plug in. Everything was working fine before then.
I went thru the motions of deleting the woocommerce plug in and re-installing and adding 40 products, then deleted the products and currently re-adding them and still no joy. HELP!
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwoocommerce%2Fwoocommerce%2Fissues%2F16620%23issuecomment-402897570&data=02%7C01%7C%7C68e6f497505d420a279908d5e2df548f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636664371173151538&sdata=4UfkV8GTGZO1dCv6isY27lwJbVVkkE%2BwDoButAxe0cE%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAm8cuVKEij_jjgMOQEoprPmI0tuRKo20ks5uDrx7gaJpZM4PEAKf&data=02%7C01%7C%7C68e6f497505d420a279908d5e2df548f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636664371173151538&sdata=9HYSUbzvu9E1uQu9mncwk0rVvIwcd6Fq3%2BGlUGVVL5k%3D&reserved=0.
Yes, every variation has a price.
Sent from Mail for Windows 10
From: doferdude Sent: Friday, 6 July 2018 4:03 PM To: woocommerce/woocommerce Cc: BobRafto; Comment Subject: Re: [woocommerce/woocommerce] Variable product display as 'out ofstock' when there is stock. (#16620)
Have you set a price for each individual variation? None of them show as in stock unless the price has been set on EVERY variation.
On 6 Jul 2018 02:25, BobRafto notifications@github.com wrote:
I have the same problem in red text 'This product is currently out of stock and unavailable.'
I believe this problem among others happened when I upgraded the woocommerce plug in. Everything was working fine before then.
I went thru the motions of deleting the woocommerce plug in and re-installing and adding 40 products, then deleted the products and currently re-adding them and still no joy. HELP!
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwoocommerce%2Fwoocommerce%2Fissues%2F16620%23issuecomment-402897570&data=02%7C01%7C%7C68e6f497505d420a279908d5e2df548f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636664371173151538&sdata=4UfkV8GTGZO1dCv6isY27lwJbVVkkE%2BwDoButAxe0cE%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAm8cuVKEij_jjgMOQEoprPmI0tuRKo20ks5uDrx7gaJpZM4PEAKf&data=02%7C01%7C%7C68e6f497505d420a279908d5e2df548f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636664371173151538&sdata=9HYSUbzvu9E1uQu9mncwk0rVvIwcd6Fq3%2BGlUGVVL5k%3D&reserved=0.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
BobRafto I had the same problem but I was able to solve it. There must be something you're missing out. I can take a look if you want. ;)
See here - https://snag.gy/GtaMjD.jpg
Great, what do you require?
Sent from Mail for Windows 10
From: magnoliacom Sent: Saturday, 7 July 2018 3:52 AM To: woocommerce/woocommerce Cc: BobRafto; Comment Subject: Re: [woocommerce/woocommerce] Variable product display as 'out ofstock' when there is stock. (#16620)
BobRafto I had the same problem but I was able to solve it. There must be something you're missing out. I can take a look if you want. ;) — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Send me an email at genevieve@magnoliacom.ca
It’s OK, I’ve resolved the matter.
When I was testing I didn’t set the size required when adding to cart.
Thanks for your offer to help.
Sent from Mail for Windows 10
From: magnoliacom Sent: Saturday, 7 July 2018 3:52 AM To: woocommerce/woocommerce Cc: BobRafto; Comment Subject: Re: [woocommerce/woocommerce] Variable product display as 'out ofstock' when there is stock. (#16620)
BobRafto I had the same problem but I was able to solve it. There must be something you're missing out. I can take a look if you want. ;) — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Good!
This may sound obvious but also please make sure your variations are "enabled":
Thank you, problem is fixed.
Sent from Mail for Windows 10
From: Chris Liu-Beers Sent: Wednesday, 11 July 2018 9:27 PM To: woocommerce/woocommerce Cc: BobRafto; Comment Subject: Re: [woocommerce/woocommerce] Variable product display as 'out ofstock' when there is stock. (#16620)
This may sound obvious but also please make sure your variations are "enabled"
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Had two products with the same behavior. What fixed it for me was setting the stock to 0, saving, then back to the desired value. Setting it to a higher value and then to the intended one did not work, had to be 0.
Can anyone else confirm this?
In my case, i had a crazy import script. Possibly errors occurred.
Stock status wasn't syncing, but doing it manually works.
Calling this in my script solves it: WC_Product_Variable::sync( $variable_product,true); http://woocommerce.wp-a2z.org/oik_api/wc_product_variablesync/
Admittedly, this is a hack.
In my case WC_Product_Variable::sync( $variable_product,true);
stock status wasn't syncing.
Manual update with update_post_meta($product_id, '_stock_status', 'instock');
works, status syncing.
I'm having this exact issue with a client site. However, this only happens at complete random. All day the product will be normal. Then it will randomly remove the product-summary and display 'out of stock' even though the variations are fine. I've tested the order process and it's completely fine, it has to be something with a cron or background function mis-aligning the inventory.
@yunusga I'm curious about your fix, as it seems most similar to what i believe the issue could be. Did you set this up as a cron or a standalone replacement function?
@DLzer try this:
If parent product has variations and variations has stock count, disable _manage_stock
for parent product and enable _manage_stock
for variations
@yunusga All products are managed at the variation level. Not the parent.
I've added:
// Sync the product before returning it if( !WC_Product_Variable::sync($id, true) ) { exit; }
to my content-single-product.php
template to force a sync of the inventory before displaying.
Some of my variable products get out of stock randomly.
I have found a workaround to fix this, by adding this part to ‘templates/single-product/add-to-cart/variable.php’:
if ( empty( $available_variations ) ) :
$product::sync_stock_status($product, true);
$product = null;
$product = new WC_Product_Variable( $product_id );
$attributes = $product->get_variation_attributes();
$available_variations = $product->get_available_variations();
endif;
I have further found out that this method
$product->get_children()
origins from WC_Product_Variable_Data_Store_CPT
method read_children
L:117 which tries to load variable post_id’s from transient named:
$children_transient_name = 'wc_product_children_' . $product->get_id();
and when I checked transient for my product, that transient indeed shows 0 product ID’s in there.
And if I delete that transient, when the transient gets regenerated again I can see that ID’s are populated properly and that everything is back to normal.
I’m not sure why would this fail and where could this thing be triggered to generate transient without parent product ID’s, variations are definitely in db and any WP_Query(['post_parent' => $product->get_id()])
should return these products..
I would like to add one more point to the discussion: When setting a product as variable, parent price disappears and variation price is required. If no variation price is set, then the variation will be automatically out of stock. I find this fundamentally wrong and illogical and I believe this confuses admins and leads them to think there is a problem with WC.
It is way more common than a variation has the same exact price as the parent, than a custom price. Having to set the same price for 10, 30 or more variations is a waste of time and should only be necessary if the variation actually varies in price, if not, inherit the parent's "default" price.
Hi,
I kind of agree the user experience for variations is suboptimal. I think there is a plan to review this somewhere in 2019. In the meantime, users can use 'Set regular prices' from the Variations panel to set price for variations en masse.
@peterfabian that's good news, even though I wish it would happen a little faster. I dont see any "Set regular prices" in the Variations panel... ?!
Also, should I make a new thread about this so it can be tracked?
Sorry, should have been clearer. You can pick different actions from the dropdown as you can see below in Admin -> Products -> edit individual product, then:
1.
2.
Update wp_postmeta Set meta_value = 'instock' Where meta_value = 'outofstock' And meta_key = '_stock_status'
In SQl
Disable Wpml Woocommerce !!!
This is an issue for me too. 100 in stock but client gets a random email about low stock, checks stock and its fine. What are the odds that someone added 99 items to their cart of our same product? Hint: I think pretty low. Maybe not?
I have just noticed this problem as well. I have a variable product that is set up such that the "Manage stock?" checkbox under Product Data > Inventory of the edit product page is unchecked. Under Product Data > Variations, for each variation, the "Manage stock?" box is checked, as well as the "Enabled:" box. Several of the variations are in stock. Initially, the product was displaying correctly as being in stock.
After I used WooCommerce's built-in product importer to import (update) ONLY the variable product (i.e. parent product), the product began to show as "Out of stock" on the product search page. After reimporting the product (again, set to update existing products) along with its variations, it now shows as "In stock" again.
In summary, importing updates to existing products without their variations seems to break the stock status of a variable product. This certainly seems like a bug, as one would expect to be able to update a variable product through the importer without also importing its variations.
Hi @corey30d, please create a new bug report, ideally attaching a minimal example of a file that we can use to reproduce the problem and steps to do so.
Thanks for reporting the problem.
I am troubleshooting a similar issue. get_children is deprecated in WC 3.x I have used this method to reliably get variations when I pass this 'edit' parameter ->get_visible_children('edit');
Speaking of this issue, I was experiencing the same issue. I am not sure what is happening with it. I noticed after changing that the variations are in stock, I still was getting the same out of stock message on the product.
If you log out of Wordpress and relogin, it tends to refresh and says that variation is out of stock if you update them again and save, it fixes it.
@wstrwyatt yep, that was my client was experiencing. After saving the product the variable subscriptions would go back in stock. I ended up creating a plugin that created 10-15 hacks to get this fixed. The client allowed me to publish it I am thinking of doing this at some point.
I thought i had this problem but it seems I don't... Do the posters above realize you HAVE to set the 'Regular price ($)' for EVERY variation in order for it to work correctly? I have 12 variations and it appeared out of stock despite all the 'stock management' functions deselected. Once i set a price for each variation it worked perfect. http://antiquewoodsllc.com/product/reclaimed-antique-oak/
Amazing, I was completely stuck with the "out of stock" error reoccurring but thanks to your note, fixed everything and it works perfect. It makes sense, the variations have to have prices. Thank you doferdude, you're a genius, straight up. You saved me!
This may sound obvious but also please make sure your variations are "enabled":
I had that problem for many weeks now and it was annoying. I tried a lot of fixes with no luck. But hey, my variations weren't marked as «Enabled»... Works perfectly now. Thanks!
I've had this issue of woocommerce variable products being in stock but displaying as out of stock, which sync's with epos now. All of my products started as simple products and were converted to variable products.
The main points are:
Manage stock is ticket for each variation Every Variation is priced in the variation tab (regular price) Stock management at product level is unticked
My fix was to go back in to each product and hit update. Following that, the product displays correctly on the front end.
Now to update 1100 products one by one!
Prerequisites
master
branch of WooCommerce on GithubSteps to reproduce the issue
Some of variable products shows as "Out of stock". However, there is stock in the variable product.
This problem occurs in some of products only. I compared with other variable product those without problem, there is no different in all the setting. (As I import them in one batch of CSV) Sometimes problem occur after a customer purchase the product.
Thank you.
Isolating the problem
WordPress Environment