8

I've recently updated a non-production version of a website from 2.4.4 to 2.4.5. The site has a number of configurable products with options for colours etc. The simple products behind the configurables are set to search only visibility whereas the configurable is set to catalog/search visibility. This all worked fine in 2.4.4, 2.4.3 and previous versions.

Since i've upgraded to 2.4.5, the filter is broken. All the products that are set to search only are appearing on the category page. If I select a colour filter, eg. green, other colour products are still being displayed.

I've tried reindexing, updating the products, setup:upgrade etc and none of this seems to work.

Elasticsearch also seems fine.

The site is running on Ubuntu 20.04, Apache and Php 7.4

I've done some additional investigation and it looks like incorrect values are being written to Elasticsearch. I've manually queried one set of products and the visibility on the Elasticsearch query result is being returned as 4 when it should be 3

3
  • Additional info. If i downgrade the site back to 2.4.4 or 2.4.4p1, it works as expected. Commented Sep 1, 2022 at 15:09
  • Have you tried compiling static files bin/magento setup:static-content:deploy -f? -- Probably requires more information in order to find the problem. An actual staging website to inspect the problem, are modules used in order to change the layered navigation and so on. If changes where made on layered naviagtion (in custom theme / modules) we would need the code. Commented Sep 2, 2022 at 14:27
  • Thanks for the reply. I have tried compiling the static files. The site itself is currently in developer mode but putting it into production mode doesn't fix the problem. Commented Sep 2, 2022 at 14:42

4 Answers 4

3

I was facing the same issue when I upgraded my magento store from 2.4.4 to 2.4.5-p1.

Solution1: I found this patch and fixed the issue. https://github.com/magento/magento2/commit/a9170022cce29993e586ffaa6f4c1cc357ee3b11

Solution2: Actually, This issue is occurring because of Out of Stock products are moved to bottom of the page now. So if you don't want to display Out of Stock products on front-end then please mark 'No' the setting below... Stores > Configuration > Catalog > Inventory > Display Out of Stock Products. Then flush magneto cache and re-index if required.

2

You should change Display product out of stock configuration settings. Make sure it is set to No from STORES > Configuration > Catalog > Inventory > Display Out of Stock Products settings. Once saved the configuration flush the cache:

php bin/magento c:c

and do not forget to reindex

php bin/magento indexer:reindex

And then check your product listing filters again, they should work now.

1
  • Thanks for the reply. I've checked the display product out of stock setting and products should already be displayed if they are out of stock. I've also run the cache clean and indexer and this hasn't solved the issue. I've even run php bin/magento indexer:reset but this didn't work either. Commented Sep 7, 2022 at 14:55
2

My issue is connected to this issue reported here Custom sorting on category pages not working if out of stock products are shown #36113 The issue is that if show out of stock products is enabled, custom sorting does not work on category pages.

As a workaround, i've changed function \Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\SearchResultApplier::apply, line 108, so that it doesn't call the new getProductIdsBySaleability function. This isn't ideal but it has fixed the issue for now.

1
0

Please try with this patch it's working for me in version 2.4.5-p3 https://github.com/magento/magento2/commit/a9170022cce29993e586ffaa6f4c1cc357ee3b11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.