woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.32k stars 10.75k forks source link

Variable product display as 'out of stock' when there is stock. #16620

Closed kaihchan8 closed 7 years ago

kaihchan8 commented 7 years ago

Prerequisites

Steps to reproduce the issue

Some of variable products shows as "Out of stock". However, there is stock in the variable product. image

image

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

### WordPress Environment ### Home URL: http://bluebelloutlet.com Site URL: http://bluebelloutlet.com WC Version: 3.1.1 Log Directory Writable: ✔ WP Version: 4.8.1 WP Multisite: – WP Memory Limit: 768 MB WP Debug Mode: – WP Cron: ✔ Language: en_US ### Server Environment ### Server Info: Apache PHP Version: 7.0.22 PHP Post Max Size: 128 MB PHP Time Limit: -1 PHP Max Input Vars: 3000 cURL Version: 7.53.0 OpenSSL/1.0.2k SUHOSIN Installed: – MySQL Version: 5.6.36 Max Upload Size: 128 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 2.6.14 WC Database Prefix: wp_wzffdz1frw_ woocommerce_sessions: ✔ woocommerce_api_keys: ✔ woocommerce_attribute_taxonomies: ✔ woocommerce_downloadable_product_permissions: ✔ woocommerce_order_items: ✔ woocommerce_order_itemmeta: ✔ woocommerce_tax_rates: ✔ woocommerce_tax_rate_locations: ✔ woocommerce_shipping_zones: ✔ woocommerce_shipping_zone_locations: ✔ woocommerce_shipping_zone_methods: ✔ woocommerce_payment_tokens: ✔ woocommerce_payment_tokenmeta: ✔ MaxMind GeoIP Database: ✔ ### Security ### Secure connection (HTTPS): ❌Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates. Hide errors from visitors: ✔ ### Active Plugins (20) ### Better Search Replace: by Delicious Brains – 1.3 Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 6.2.2 WPBakery Visual Composer: by Michael M - WPBakery.com – 4.11 Ninja Forms: by The WP Ninjas – 3.1.9 Popup Maker: by WP Popup Maker – 1.6.5 Replace Image: by Potent Plugins – 1.1.6 Search & Replace: by Inpsyde GmbH – 3.1.2 Shortcode Widget: by Gagan Deep Singh – 1.4 WooCommerce All Discounts Lite: by ORION – 1.3 Woo Checkout Field Editor Pro: by ThemeHiGH – 1.2.0 WooCommerce Email Test: by RaiserWeb – 1.9 WooCommerce PDF Invoices & Packing Slips: by Ewout Fernhout – 2.0.7 WooCommerce Shipping Tracking: by Lagudi Domenico – 12.2 WooCommerce: by Automattic – 3.1.1 – 3.1.2 is available Hustle: by WPMU DEV – 5.1.5 WP All Export Pro: by Soflyy – 1.4.7 WP All Import Pro: by Soflyy – 4.4.9 WP Media Category Management: by DeBAAT – 1.9.1 WP All Import - WooCommerce Add-On Pro: by Soflyy – 2.3.7 Advanced Custom Fields: by Elliot Condon – 4.4.11 ### Settings ### API Enabled: ✔ Force SSL: ✔ Currency: HKD (HK$) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) ### WC Pages ### Shop base: #26 - /shop/ Cart: #7 - /cart/ Checkout: #8 - /checkout/ My account: #9 - /account/ ### Theme ### Name: Shopkeeper Version: 2.0.10 Author URL: https://www.getbowtied.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: shopkeeper/woocommerce/archive-product.php shopkeeper/woocommerce/cart/cart-empty.php shopkeeper/woocommerce/cart/mini-cart.php shopkeeper/woocommerce/checkout/form-checkout.php shopkeeper/woocommerce/checkout/form-coupon.php shopkeeper/woocommerce/checkout/form-login.php shopkeeper/woocommerce/content-product.php shopkeeper/woocommerce/content-product_cat.php shopkeeper/woocommerce/content-single-product.php shopkeeper/woocommerce/global/quantity-input.php shopkeeper/woocommerce/global/sidebar.php shopkeeper/woocommerce/global/wrapper-end.php shopkeeper/woocommerce/global/wrapper-start.php shopkeeper/woocommerce/loop/loop-end.php shopkeeper/woocommerce/loop/loop-start.php shopkeeper/woocommerce/loop/no-products-found.php shopkeeper/woocommerce/myaccount/form-login.php shopkeeper/woocommerce/myaccount/my-downloads.php shopkeeper/woocommerce/order/form-tracking.php shopkeeper/woocommerce/single-product/product-image.php shopkeeper/woocommerce/single-product/product-thumbnails.php shopkeeper/woocommerce/single-product/tabs/tabs.php shopkeeper/woocommerce/single-product-reviews.php shopkeeper/woocommerce/single-product.php
mikejolley commented 7 years ago

On the inventory tab, turn off stock management at product level. You want it to be based on variations instead.

jfksdca commented 6 years ago

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.

mikejolley commented 6 years ago

@jfksdca If you're referring to the stock status dropdown, variables don't have it because they sync with variations.

jfksdca commented 6 years ago

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.

mikejolley commented 6 years ago

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

jfksdca commented 6 years ago

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 .

SherpaDigital commented 6 years ago

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).

mikejolley commented 6 years ago

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.

brandenMB commented 6 years ago

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.

madaboutu commented 6 years ago

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?

peterfabian commented 6 years ago

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.

doferdude commented 6 years ago

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/

jwhite0229 commented 6 years ago

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

magnoliacom commented 6 years ago

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..

jwhite0229 commented 6 years ago

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.

magnoliacom commented 6 years ago

Huh, still working for me.. Will let you know later!

jwhite0229 commented 6 years ago

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.

magnoliacom commented 6 years ago

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.

BobRafto commented 6 years ago

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.

doferdude commented 6 years ago

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.

BobRafto commented 6 years ago

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.

magnoliacom commented 6 years ago

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

BobRafto commented 6 years ago

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.

magnoliacom commented 6 years ago

Send me an email at genevieve@magnoliacom.ca

BobRafto commented 6 years ago

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.

magnoliacom commented 6 years ago

Good!

tomatillodesign commented 6 years ago

This may sound obvious but also please make sure your variations are "enabled":

screen shot 2018-07-11 at 7 23 29 am

BobRafto commented 6 years ago

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.

Aionictic commented 6 years ago

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?

jdar commented 6 years ago

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.

yunusga commented 6 years ago

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.

DLzer commented 6 years ago

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?

yunusga commented 6 years ago

@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

DLzer commented 6 years ago

@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.

Bobz-zg commented 6 years ago

Some of my variable products get out of stock randomly.

  1. They appear as ‘out of stock’ on front end
  2. When I check in wp-admin I can see them there, but if I try to re-save them then they start to appear as out of stock, then I hit another save and then they appear back to stock again
  3. I have checked in database what is going on but I can see no change neither in variables ‘post’ neither in product ‘post’ or postmeta on save
  4. When products are shown out of stock (even they should be in stock), I can notice that method $this->get_children() ( class WC_Product_Variable L:202 ) is returning empty array

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..

Jany-M commented 6 years ago

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.

peterfabian commented 6 years ago

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.

Jany-M commented 6 years ago

@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?

peterfabian commented 6 years ago

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. variation_update

2. variation_update2

BrandsDropship commented 6 years ago

Update wp_postmeta Set meta_value = 'instock' Where meta_value = 'outofstock' And meta_key = '_stock_status'

In SQl

dima8nep commented 6 years ago

Disable Wpml Woocommerce !!!

abossola commented 5 years ago

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?

corey30d commented 5 years ago

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.

peterfabian commented 5 years ago

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.

lordspace commented 5 years ago

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');

wstrwyatt commented 5 years ago

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.

lordspace commented 5 years ago

@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.

ScottInJupiter commented 5 years ago

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!

alexannelap commented 5 years ago

This may sound obvious but also please make sure your variations are "enabled":

screen shot 2018-07-11 at 7 23 29 am

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!

liquidpictures commented 5 years ago

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!