Magento 2.4.5 category page out of stock products not showing.
Even magento admin -> stores -> config -> catalog -> inventory setting is enabled ?
I tried with default magento but not found any solution. Can anyone facing same issue and have solution ?
2
Answers
I debug a lot and finally found the major bug in 2.4.5.
vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php
Just change apply function like 2.4.4
There must be issued in your product or Magento Elasticsearch configuration. You need to perform steps to reproduce in displaying the Out of Stock Products.
To display out-of-stock products from admin:
Follow the steps:
1: Stores>Configuration>Catalog>Inventory
2: Open the Stock Options dropdown.
3: Set Yes in the Display Out of Stock Products option
If that doesn’t work, check your Elasticsearch version.
Also cleared cache: System->Cache Management
If Memcached or Redis cache is configured clear the cache first.
Finally, also, check your theme to display out of stock it can also create an issue with it.
That’s it