@@ -2530,22 +2530,22 @@ protected function _saveStockItem()
2530
2530
2531
2531
$ row = [];
2532
2532
$ sku = $ rowData [self ::COL_SKU ];
2533
+ $ storeId = $ this ->getRowStoreId ($ rowData );
2533
2534
if ($ this ->skuProcessor ->getNewSku ($ sku ) !== null ) {
2534
2535
$ stockItem = $ this ->getRowExistingStockItem ($ rowData );
2535
2536
$ existingStockItemData = $ stockItem ->getData ();
2536
2537
$ row = $ this ->formatStockDataForRow ($ rowData );
2537
2538
$ productIdsToReindex [] = $ row ['product_id ' ];
2538
- $ storeId = $ this ->getRowStoreId ($ rowData );
2539
2539
if (!empty (array_diff_assoc ($ row , $ existingStockItemData ))
2540
2540
|| $ this ->statusProcessor ->isStatusChanged ($ sku , $ storeId )
2541
2541
) {
2542
2542
$ stockChangedProductIds [] = $ row ['product_id ' ];
2543
2543
}
2544
2544
}
2545
2545
2546
- if (!isset ($ stockData [$ sku ])) {
2547
- $ stockData [$ sku ] = $ row ;
2548
- $ importedData [$ sku ] = $ rowData ;
2546
+ if (!isset ($ stockData [$ sku ][ $ storeId ] )) {
2547
+ $ stockData [$ sku ][ $ storeId ] = $ row ;
2548
+ $ importedData [$ sku ][ $ storeId ] = $ rowData ;
2549
2549
}
2550
2550
}
2551
2551
@@ -3399,7 +3399,7 @@ private function formatStockDataForRow(array $rowData): array
3399
3399
{
3400
3400
$ sku = $ rowData [self ::COL_SKU ];
3401
3401
$ row ['product_id ' ] = $ this ->skuProcessor ->getNewSku ($ sku )['entity_id ' ];
3402
- $ row ['website_id ' ] = $ this ->stockConfiguration ->getDefaultScopeId ();
3402
+ $ row ['website_id ' ] = $ this ->stockConfiguration ->getDefaultScopeId ();//here be the problem
3403
3403
$ row ['stock_id ' ] = $ this ->stockRegistry ->getStock ($ row ['website_id ' ])->getStockId ();
3404
3404
3405
3405
$ stockItemDo = $ this ->stockRegistry ->getStockItem ($ row ['product_id ' ], $ row ['website_id ' ]);
0 commit comments