Skip to content

Commit 8a4cd81

Browse files
ACPT-1327
Resetting min quantity cache in Magento/CatalogInventory/Helper/Minsaleqty Resetting isQtyTypeIds in Magento/CatalogInventory/Model/Configuration
1 parent 0f58b3e commit 8a4cd81

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

app/code/Magento/CatalogInventory/Helper/Minsaleqty.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88

99
use Magento\Customer\Api\GroupManagementInterface;
1010
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1112
use Magento\Framework\Serialize\Serializer\Json;
1213
use Magento\Store\Model\Store;
1314

1415
/**
1516
* MinSaleQty value manipulation helper
1617
*/
17-
class Minsaleqty
18+
class Minsaleqty implements ResetAfterRequestInterface
1819
{
1920
/**
2021
* Core store config
@@ -61,6 +62,14 @@ public function __construct(
6162
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
6263
}
6364

65+
/**
66+
* @inheritDoc
67+
*/
68+
public function _resetState(): void
69+
{
70+
$this->minSaleQtyCache = [];
71+
}
72+
6473
/**
6574
* Retrieve fixed qty value
6675
*

app/code/Magento/CatalogInventory/Model/Configuration.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
use Magento\CatalogInventory\Helper\Minsaleqty as MinsaleqtyHelper;
1010
use Magento\Framework\App\Config\ScopeConfigInterface;
1111
use Magento\Catalog\Model\ProductTypes\ConfigInterface;
12+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1213
use Magento\Store\Model\ScopeInterface;
1314
use Magento\Store\Model\StoreManagerInterface;
1415

1516
/**
1617
* Class Configuration
1718
*/
18-
class Configuration implements StockConfigurationInterface
19+
class Configuration implements StockConfigurationInterface, ResetAfterRequestInterface
1920
{
2021
/**
2122
* Default website id
@@ -122,7 +123,7 @@ class Configuration implements StockConfigurationInterface
122123
/**
123124
* All product types registry in scope of quantity availability
124125
*
125-
* @var array
126+
* @var array|null
126127
*/
127128
protected $isQtyTypeIds;
128129

@@ -151,6 +152,14 @@ public function __construct(
151152
$this->storeManager = $storeManager;
152153
}
153154

155+
/**
156+
* @inheritDoc
157+
*/
158+
public function _resetState(): void
159+
{
160+
$this->isQtyTypeIds = null;
161+
}
162+
154163
/**
155164
* @inheritdoc
156165
*/

0 commit comments

Comments
 (0)