Closed dapdx closed 7 years ago
@dapdx thank you for your report. Please provide description according to the template: with steps, actual result and expected result. Please also provide the used version. If the problem is actual for a specific tag, please, specify it and be sure that the latest update was used.
Magento 2.1 PHP 7
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 have been using this Magento 2 extension - Configurable product grid table view bought from a Magento provider to make out of stock product still visible but unavailable to choose quantity in the box . The quantity box is faded and cannot fill in.
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. We've created internal ticket MAGETWO-56480 to fix it.
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) is to modify the /vendor/magento/module-swatches/Block/Product/Renderer/Configurable.php file
change the getConfigurableOptionsIds function to this
protected function getConfigurableOptionsIds (array $attributeData) {
$ids = [];
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');
foreach ($this->getAllowProducts() as $product) {
if (0 == $StockState->getStockQty($product->getId(), $product->getStore()->getWebsiteId())) continue;
/** @var \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute $attribute */
foreach ($this->helper->getAllowAttributes($this->getProduct()) as $attribute) {
$productAttribute = $attribute->getProductAttribute();
$productAttributeId = $productAttribute->getId();
if (isset($attributeData[$productAttributeId])) {
$ids[$product->getData($productAttribute->getAttributeCode())] = 1;
}
}
}
return array_keys($ids);
}
I also have this problem. Worked in 2.0 but on 2.1 it does not.
http://foxtrotboutique.com/sally-gaucho-crop-denim-by-level-99-white.html Size 24 for example is out of stock and should not let you choose it, but it lets you pick it until you try to add to cart and then gives an out of stock message
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). I've prepared simple module to that: https://github.com/mjankiewicz/MagentoConfigurableProduct
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). Badly need a fix for this issue for our client.
Thanks!
Hi @MhorGonzales,
1) the module is enabled ? php bin/magento module:status
2) do you see some error messages on the frontend or backend ?
@MhorGonzales
I've checked again my module on fresh Magento 2 (sample data) and everything works fine. Detail view without module:
And with module:
it seemed to work in 2.01 but on 2.1 it does not. Are you using 2.1?
-------- Original Message -------- Subject: Re: [magento/magento2] Magento 2 configurable product selection stock issue (#5948) From: mjankiewicz notifications@github.com Date: Wed, August 31, 2016 3:07 am To: magento/magento2 magento2@noreply.github.com Cc: epadmin admin@elemeno-pee.com, Comment comment@noreply.github.com
@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 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2demo
)
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, I also have this problem and i'm using 2.1.1
@magento-team
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?https://github.com/magento/magento2/issues/6799
@mjankiewicz Looks like a cool module. But I can't use composer. Do you have a .zip version?
thanks for your help guys. At this point we are scrapping our attempts for an M2 site and starting over with an M1 site.
This is really frustrating. Run into the same problem. I'm already using several 3rd party and self written modules to fix these kind of bugs. Almost three months now for such a basic functionality.
Here the query that retrieves catalog products after filter
SELECT `main_select`.`entity_id`, MAX(score) AS `relevance`
FROM (
SELECT `search_index`.`entity_id`, (((0) + (0)) * 1) AS `score`
FROM `catalogsearch_fulltext_scope2` AS `search_index`
LEFT JOIN `catalog_eav_attribute` AS `cea` ON search_index.attribute_id = cea.attribute_id
LEFT JOIN `catalog_category_product_index` AS `category_ids_index` ON search_index.entity_id = category_ids_index.product_id
LEFT JOIN `catalog_product_index_eav` AS `kam_taglia_individuale_camicia_filter` ON search_index.entity_id = kam_taglia_individuale_camicia_filter.entity_id AND kam_taglia_individuale_camicia_filter.attribute_id = 153 AND kam_taglia_individuale_camicia_filter.store_id = 2
LEFT JOIN `cataloginventory_stock_status` AS `stock_index` ON search_index.entity_id = stock_index.product_id AND stock_index.website_id = 0
WHERE (stock_index.stock_status = 1)
AND (category_ids_index.category_id = 41)
AND (kam_taglia_individuale_camicia_filter.value = '243')
) AS `main_select`
GROUP BY `entity_id` ORDER BY `relevance` DESC
LIMIT 10000
you could see the subquery
SELECT `search_index`.`entity_id`, (((0) + (0)) * 1) AS `score`
FROM `catalogsearch_fulltext_scope2` AS `search_index`
LEFT JOIN `catalog_eav_attribute` AS `cea` ON search_index.attribute_id = cea.attribute_id
LEFT JOIN `catalog_category_product_index` AS `category_ids_index` ON search_index.entity_id = category_ids_index.product_id
LEFT JOIN `catalog_product_index_eav` AS `kam_taglia_individuale_camicia_filter` ON search_index.entity_id = kam_taglia_individuale_camicia_filter.entity_id AND kam_taglia_individuale_camicia_filter.attribute_id = 153 AND kam_taglia_individuale_camicia_filter.store_id = 2
LEFT JOIN `cataloginventory_stock_status` AS `stock_index` ON search_index.entity_id = stock_index.product_id AND stock_index.website_id = 0
WHERE (stock_index.stock_status = 1)
AND (category_ids_index.category_id = 41)
AND (kam_taglia_individuale_camicia_filter.value = '243')
the issue is that the query joins between catalog_product_index_eav
'entity_id','attribute_id','store_id','value',
'2233','153','1','216',
'2233','153','1','217',
'2233','153','1','243',
'2233','153','2','216',
'2233','153','2','217',
'2233','153','2','243',
'2233','153','3','216',
'2233','153','3','217',
'2233','153','3','243',
'2233','153','4','216',
'2233','153','4','217',
'2233','153','4','243'
where table correctly has ONLY CONFIGURABLE PRODCUTS, but INCORRECTLY has attribute value of child products that are OUT OF STOCK (compared to magento1.9). I think there is an error in reindex process that not clean properly this table.
if i clean manually the table removing out of stock record, after run magento indexer:reindex catalog_product_attribute
they return! The reindex is bugged, please verify and confirm! (magento 2.1.2)
Related question:
is normal that if i flagged USE PRODUCT FLAT TABLE, magento continue to use and search in catalog_product_index_eav
?
@duhon, what's the status of this bug? We can't publish our website without a proper solution. Thanks
Any news?
EHILA???!?!?! no one magento contributor here? It is very incredible how magento release these bug, they deserve a nobel.
I also have this problem in v. 2.1.2
I have the same issue in Magento 2.1.2 It won't even stop showing item with 0 quantity and buyers can still buy it. And I chose not to show any product out of stock, but the issue still there. Tried to install mjankiewicz's project. But actually I have no idea how to do that. I use it as a extension (put it under app/code/mjankiewicz/MagentoConfigurableProduct) And put all files into it. Than use php bin/magento setup:upgrade and php bin/magento setup:di:compile But it ends up with errors. Does any one can tell me how to use the project@@?
A very, very big and frustrating problem :(
Any update for this???? All sentiments about how this is a problem has already been shared, so I won't reiterate, but need a fix. @mjankiewicz will this work on Magento 2.1.2 installation? Thanks!
@jmtakahashi yes. it works with 2.1.2
@mjankiewicz thanks! will test installation now.
We totally agree with @immist
The community has found 2 major bugs on your configurable products (#6799 and #5762), 1 crashing the entire catalog, and the other one not handling configurable options stock properly. It is hard to think that we have to look for third party extension or in-house development to overcome these issues.
@magento-admin @magento-team : when can we expect for you to attend these issues ?
We thank you in advance to let us know about the status of these issues.
I have just upgraded 2.1.2 to 2.1.3:
2.1.3 release notes:
Magento now correctly displays the status of all child products of a configurable product, even disabled ones. Previously, Magento did not correctly display the status of a configurable product’s child product if the child product were disabled.
However, I am still having this issue. Has 2.1.3 resolved this for anyone? Perhaps I have missed something?
Any updates on this issue, very frustrating that this simple feature does not work. Thanks
Magento 2.1.3 solved this issue for us.
Did Magento 2.1.3 solve this for anyone else?
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. See the answer
@dapdx, thank you for your report. We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
its only work on swatches icons not on dropdown
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.