-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Magento 2 configurable product selection stock issue #5948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@dapdx thank you for your report. |
Magento 2.1 Steps to Reproduce
Expected Result
Actual Result
|
I also have the same problems and then I have to use an extension from the third part to solve it although this issue can be overcome quite easily in Magento 1 as you have said. |
I can confirm this on a fresh 2.1 system. Really bad bug as we have lots of sizes :-/ |
@dapdx Thanks for reporting this issue. |
This bug came up when I updated a site from 2.02 to 2.1. Before the out-of-stock options were not shown. A quick fix to hide them (probably won't work with multiple options) change the getConfigurableOptionsIds function to this
|
I also have this problem. Worked in 2.0 but on 2.1 it does not. |
Hi, I had similar problem but the client did not want to hide products out of stock but display on gray or other a style (as unavailable). Maybe it will be useful for someone :) |
Hi @mjankiewicz, Tried installing your module (followed the steps), but wasn't able to make it work (tried to install it on a fresh M2.1 environment). Thanks! |
Hi @MhorGonzales,
|
it seemed to work in 2.01 but on 2.1 it does not. Are you using 2.1? -------- Original Message -------- @MhorGonzales I've checked again my module on fresh Magento 2 (sample data) and everything works fine. Detail view without module: And with module: —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread. |
Yes. I use Magento ver. 2.1.1 (installed by |
Hi @mjankiewicz, Thank you for the response, after investigation, it seems that this conflicts with the extension MagicToolbox_MagicZoom. Anyway, it is working now. However, is there a tweak where in it should show the slash/not-available, if just the status alone is "Out of Stock", regardless of the "Quantity" value? As observed, "Quantity" should be set to zero (0) for this to work. Thank you in advance. |
@mjankiewicz Does it mean, this issue is still not yet resolved in 2.1.1??? |
Yes. The issue isn't resolved in 2.1.1. (tested on fresh installation Magento 2.1.1 with sample data) |
Hi, |
This is another MUST-FIX bug - a normal logic at an commerce site! I have no idea why this worked before and is missing now. Can you pls give us a feedback when this one will work again. I think one of the main problems with m2 at this stage is that new bugs come in with every release like waves at a beach - and only some are fixed. Very frustrating at the moment to be honest. |
Can confirm the problem with 2.1.1 And @mjankiewicz 's module worked great! Thanks a lot, really saved my hair :) |
Thanks @mjankiewicz, your module is working for me on 2.1.1. BTW. Is anyone here using M2 on live site with configurable products and if so how did you resolve this issue with first associated product becoming out of stock?#6799 |
2.1.3 solved for me too. |
am using 2.1.5 but these problem stile there ! I must to change status manually vi MySQL |
What variable do you change in MySQL? |
stock_status to 1 on cataloginventory_stock_status table but now I change PHP version to 5.6 and it's work fine |
Just upgraded to 2.1.7 and this is still an issue for us. The module https://github.com/mjankiewicz/MagentoConfigurableProduct works ok for swatches, but not drop downs. Does anyone have a fix? |
For magento 2.1.6 to work i was needed to create another custom module. |
@dapdx, thank you for your report. |
its only work on swatches icons not on dropdown |
Awesome solution..Its working |
So it this issue fixed properly in 2.1.9? Meaning, swatches are still displayed, but unselectable? Currently, my store just hides the sizes that are out of stock, and only shows sizes that are in stock. I'n assuming this is proper behavior, but is there way to show the sizes that are out if stock as well, and disable them from being selectable? |
I have checked this in 2.2.0. After applying above solution, It shows sizes which are out of stock and they wont be selectable. |
@diptihere which solution are you referring to? The mjankiewicz extension doesn't work "out of the box" on my 2.1.9 store. |
Yes, mjankiewicz extension. It worked for me. U just have to override this getOptions method. Is there any error u r getting. |
@diptihere how do I override the getOptions method? Maybe thats where the problem is. |
Magento 2.2.1 - I have tried the solution from @mjankiewicz but the product pages and search return blank or broken. Update: @mjankiewicz works when installed via composer. When I tried via zip and upload, it didn't but does when installed via composer. |
Magento 2.2.2 - Still not working... @mjankiewicz your solution is only a partial fix. If only one attribute Size as Text Swatch is available ( Size dropped ) Looking at the php and javascript there does not seem to be an easy fix for every situation. In my opinion all available Simple products should always render ( with exception of disabled Simple products ) Something like; |
@dawhoo @Wernervanrun I think I have found the reason why this error appeared. Please, review this PR - #12936 The main problem, from my point of view, was in the incorrect stock status filter appliance. It was successfully implemented previously in About suggested solution in the helper class: to be honest, it is totally not good to call the object load in the loop. This generates extra load. Much better to get needed data in one collection call to avoid performance issue. |
Hi @dapdx. Thank you for your report. The fix will be available with the upcoming patch release. |
In Magento 2.2.2 Worked out a plugin to allow for out of stock child option products of a configurable product to work in concert with the @mjankiewicz helper. Key point was in: vendor/magento/module-configurable-product/Model/ResourceModel/Attribute/OptionSelectBuilder.php Created a plugin to modify the select to allow for out of stock products in the configurable options: `<?php namespace Watermelon\OutofStockChildProductSwatchVisible\Plugin\Magento\ConfigurableProduct\Model\ResourceModel\Attribute; class OptionSelectBuilder public function afterGetSelect(
} |
[TSG-CSL3] For 2.4 (pr34)
Setting up configurable products and using the text swatch option to select shirt sizes. The issue is the out of stock shirt text swatches are still showing up, clickable, and have no styling to show that they are out of stock. I'd like the swatch to still show up, but not be clickable and appear faded out or something so you know they are out of stock. Any help?
I'm not seeing any class for out of stock being passed through that I can style with CSS.
This worked fine in Magento 1, where on drop downs the out of stock simple products were not selectable, but in Magento 2, both on drop downs and text swatches they still show up and you can click on them, but when added to the cart you get the "product not in stock" error.
The text was updated successfully, but these errors were encountered: