Skip to content

Commit 22f262b

Browse files
committed
ACP2E-4142: Post-Patch ACP2E-4118: Stock Threshold Change in Admin Causes Negative Salable Quantities and Stock Status Mismatch
1 parent c93ac28 commit 22f262b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3399,7 +3399,7 @@ private function formatStockDataForRow(array $rowData): array
33993399
{
34003400
$sku = $rowData[self::COL_SKU];
34013401
$row['product_id'] = $this->skuProcessor->getNewSku($sku)['entity_id'];
3402-
$row['website_id'] = $this->stockConfiguration->getDefaultScopeId();//here be the problem
3402+
$row['website_id'] = $this->stockConfiguration->getDefaultScopeId();
34033403
$row['stock_id'] = $this->stockRegistry->getStock($row['website_id'])->getStockId();
34043404

34053405
$stockItemDo = $this->stockRegistry->getStockItem($row['product_id'], $row['website_id']);

app/code/Magento/CatalogImportExport/Model/StockItemProcessor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\CatalogImportExport\Model;
99

10+
use Magento\CatalogImportExport\Model\Import\Product;
1011
use Magento\Store\Model\Store;
1112

1213
class StockItemProcessor implements StockItemProcessorInterface
@@ -32,8 +33,8 @@ public function process(array $stockData, array $importedData): void
3233
{
3334
$importStockData = [];
3435
foreach ($stockData as $sku => $productStockData) {
35-
if (isset($stockData[Store::DEFAULT_STORE_ID])) {
36-
$importStockData[$sku] = $productStockData[Store::DEFAULT_STORE_ID];
36+
if (isset($stockData[Product::SCOPE_DEFAULT])) {
37+
$importStockData[$sku] = $productStockData[Product::SCOPE_DEFAULT];
3738
} else {
3839
$importStockData[$sku] = reset($productStockData);
3940
}

0 commit comments

Comments
 (0)