Skip to content

Commit 6c44d17

Browse files
committed
ACP2E-748: Layered navigation filters don't work when "show out of stock" is enabled
1 parent cfddf04 commit 6c44d17

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CatalogInventory\Model;
9+
10+
/**
11+
* Search Result Applier getters and setters
12+
*
13+
* @deprecated - as the implementation has been reverted during the fix of ACP2E-748
14+
*/
15+
class StockStatusApplier implements StockStatusApplierInterface
16+
{
17+
/**
18+
* Storefront search result applier flag
19+
*
20+
* @var bool
21+
*/
22+
private $searchResultApplier = false;
23+
24+
/**
25+
* Set flag, if the request is originated from SearchResultApplier
26+
*
27+
* @param bool $status
28+
* @deprecated
29+
*/
30+
public function setSearchResultApplier(bool $status): void
31+
{
32+
$this->searchResultApplier = $status;
33+
}
34+
35+
/**
36+
* Get flag, if the request is originated from SearchResultApplier
37+
*
38+
* @return bool
39+
* @deprecated
40+
*/
41+
public function hasSearchResultApplier() : bool
42+
{
43+
return $this->searchResultApplier;
44+
}
45+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CatalogInventory\Model;
9+
10+
/**
11+
* Search Result Applier interface.
12+
*
13+
* @deprecated - as the implementation has been reverted during the fix of ACP2E-748
14+
*/
15+
interface StockStatusApplierInterface
16+
{
17+
18+
/**
19+
* Set flag, if the request is originated from SearchResultApplier
20+
*
21+
* @param bool $status
22+
* @deprecated
23+
*/
24+
public function setSearchResultApplier(bool $status): void;
25+
26+
/**
27+
* Get flag, if the request is originated from SearchResultApplier
28+
*
29+
* @return bool
30+
* @deprecated
31+
*/
32+
public function hasSearchResultApplier() : bool;
33+
}

app/code/Magento/CatalogInventory/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
<preference for="Magento\CatalogInventory\Model\ResourceModel\QtyCounterInterface" type="Magento\CatalogInventory\Model\ResourceModel\Stock" />
3535
<preference for="Magento\CatalogInventory\Model\ResourceModel\StockStatusFilterInterface" type="Magento\CatalogInventory\Model\ResourceModel\StockStatusFilter" />
36+
<preference for="Magento\CatalogInventory\Model\StockStatusApplierInterface" type="Magento\CatalogInventory\Model\StockStatusApplier" />
3637
<type name="Magento\Catalog\Model\Product\Attribute\Repository">
3738
<plugin name="filterCustomAttribute" type="Magento\CatalogInventory\Model\Plugin\FilterCustomAttribute" />
3839
</type>

0 commit comments

Comments
 (0)