ACSD-48234: The catalog search result shows an incorrect category item count…
The catalog search result shows an incorrect category item count when the Display Out of Stock Products option is enabled. Quality patch ACSD-48234 for magento/module-catalog-inventory applies to Magento Open Source and Adobe Commerce 2.4.5 to 2.4.5-p17.
- Categories
- Catalog Search, Inventory
- Components
- magento/module-catalog-inventory, magento/module-elasticsearch, magento/module-inventory-catalog, magento/module-inventory-catalog-api, magento/module-inventory-elasticsearch
- Origin
- adobe-commerce-support
- Since QPT
- 1.1.25
Issue
The catalog search result shows an incorrect category item count when the Display Out of Stock Products option is enabled.
Steps to reproduce
1. Go to Stores > Attributes > Product and open color attribute. 1. Add two options, for example orange and green. Save the attribute. 1. Go to Stores > Attributes > Attribute Set and add the color attribute to the Default attribute set. 1. Go to Stores > Settings > Configuration > CATALOG > Inventory > Stock Options and set Display Out of Stock Products to _Yes_. 1. Create category "cat1". 1. Create two products: 1. Name: prod1, Color: orange, Categories: cat1. 1. Name: prod2, Color: green, Categories: cat1. 1. Open cat1 category on the storefront. 1. Select the orange color at the layered navigation.
Adobe's page lists 2.4.5 - 2.4.5-p4 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.
Adobe scheduled the permanent fix for 2.4.6.
Install
Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-48234. On Cloud, add ACSD-48234 under stage.build.QUALITY_PATCHES in .magento.env.yaml.
For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-48234/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.
Patch files and compatible versions
magento/magento2-base >=2.4.5 <2.4.5-p12
- Magento Open Source
- 2.4.5-p11, 2.4.5-p10, 2.4.5-p9, 2.4.5-p8, 2.4.5-p7, 2.4.5-p6, 2.4.5-p5, 2.4.5-p4, 2.4.5-p3, 2.4.5-p2, 2.4.5-p1, 2.4.5
- Adobe Commerce
- 2.4.5-p11, 2.4.5-p10, 2.4.5-p9, 2.4.5-p8, 2.4.5-p7, 2.4.5-p6, 2.4.5-p5, 2.4.5-p4, 2.4.5-p3, 2.4.5-p2, 2.4.5-p1, 2.4.5
- Patch file
- patches/os/ACSD-48234_2.4.5-p1.patch
- vendor/magento/module-catalog-inventory/Model/ResourceModel/StockStatusFilter.php
- vendor/magento/module-catalog-inventory/Model/StockStatusApplier.php
- vendor/magento/module-catalog-inventory/Model/StockStatusApplierInterface.php
- vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php
magento/magento2-base >=2.4.5-p12 <2.4.6
- Patch file
- patches/os/ACSD-65625_2.4.5-p12.patch
- vendor/magento/module-catalog-inventory/Model/ResourceModel/StockStatusFilter.php
- vendor/magento/module-catalog-inventory/Model/StockStatusApplier.php
- vendor/magento/module-catalog-inventory/Model/StockStatusApplierInterface.php
magento/inventory-metapackage >=1.2.5 <1.2.5-p12
- Magento Open Source
- 2.4.5-p11, 2.4.5-p10, 2.4.5-p9, 2.4.5-p8, 2.4.5-p7, 2.4.5-p6, 2.4.5-p5, 2.4.5-p4, 2.4.5-p3, 2.4.5-p2, 2.4.5-p1, 2.4.5
- Adobe Commerce
- 2.4.5-p11, 2.4.5-p10, 2.4.5-p9, 2.4.5-p8, 2.4.5-p7, 2.4.5-p6, 2.4.5-p5, 2.4.5-p4, 2.4.5-p3, 2.4.5-p2, 2.4.5-p1, 2.4.5
- Patch file
- patches/os/ACSD-48234_1.2.5.patch
- vendor/magento/module-inventory-catalog/Model/ResourceModel/SortableBySaleabilityProvider.php (added)
- vendor/magento/module-inventory-catalog/Model/ResourceModel/StockStatusFilter.php
- vendor/magento/module-inventory-catalog/Model/StockStatusApplier.php
- vendor/magento/module-inventory-catalog/Plugin/Catalog/Block/ProductList/UpdateToolbarCount.php (deleted)
- vendor/magento/module-inventory-catalog/Plugin/Catalog/Model/ResourceModel/Product/CollectionPlugin.php (added)
- vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/Model/ResourceModel/StockStatusFilterPlugin.php
- vendor/magento/module-inventory-catalog/etc/di.xml
- vendor/magento/module-inventory-catalog-api/Model/SortableBySaleabilityInterface.php (added)
- vendor/magento/module-inventory-elasticsearch/Model/ResourceModel/SortableBySaleabilityProvider.php (added)
- vendor/magento/module-inventory-elasticsearch/Plugin/Model/Adapter/BatchDataMapper/ProductDataMapperPlugin.php (added)
- vendor/magento/module-inventory-elasticsearch/Plugin/Model/Adapter/FieldMapper/AdditionalFieldMapperPlugin.php (added)
- vendor/magento/module-inventory-elasticsearch/etc/di.xml
magento/inventory-metapackage >=1.2.5-p12 <1.2.6
- Patch file
- patches/os/ACSD-65625_1.2.5-p12.patch
- vendor/magento/module-inventory-catalog/Model/ResourceModel/SortableBySaleabilityProvider.php (added)
- vendor/magento/module-inventory-catalog/Model/ResourceModel/StockStatusFilter.php
- vendor/magento/module-inventory-catalog/Model/StockStatusApplier.php
- vendor/magento/module-inventory-catalog/Plugin/Catalog/Block/ProductList/UpdateToolbarCount.php (deleted)
- vendor/magento/module-inventory-catalog/Plugin/Catalog/Model/ResourceModel/Product/CollectionPlugin.php (added)
- vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/Model/ResourceModel/StockStatusFilterPlugin.php
- vendor/magento/module-inventory-catalog/etc/di.xml
- vendor/magento/module-inventory-catalog-api/Model/SortableBySaleabilityInterface.php (added)
- vendor/magento/module-inventory-elasticsearch/Model/ResourceModel/SortableBySaleabilityProvider.php (added)
- vendor/magento/module-inventory-elasticsearch/Plugin/Model/Adapter/BatchDataMapper/ProductDataMapperPlugin.php (added)
- vendor/magento/module-inventory-elasticsearch/Plugin/Model/Adapter/FieldMapper/AdditionalFieldMapperPlugin.php (added)
- vendor/magento/module-inventory-elasticsearch/etc/di.xml
