Skip to content

Commit

Permalink
BUGFIX: added sku check empty (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
phongphanmage authored Dec 18, 2019
1 parent ef5ebe4 commit 85cf078
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Model/LoadInventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ public function execute(array $indexData, int $storeId): array
$rawInventoryByProductId = [];

foreach ($rawInventory as $sku => $productInventory) {
$productId = $productIdBySku[$sku];
$productInventory['product_id'] = $productId;
unset($productInventory['sku']);
$rawInventoryByProductId[$productId] = $productInventory;
if ( !empty($productIdBySku[$sku]) ) {
$productId = $productIdBySku[$sku];
$productInventory['product_id'] = $productId;
unset($productInventory['sku']);
$rawInventoryByProductId[$productId] = $productInventory;
}
}

return $rawInventoryByProductId;
Expand Down

0 comments on commit 85cf078

Please sign in to comment.