Skip to content

Commit

Permalink
Merge pull request magento#996 from magento-engcom/MSI-875
Browse files Browse the repository at this point in the history
MSI-875: issue with duplicating SKU in one Order
  • Loading branch information
maghamed authored Apr 21, 2018
2 parents 0e897d7 + 0eef33b commit 8d39f4c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ public function afterPlace(OrderManagementInterface $subject, OrderInterface $or
$itemsById = [];
/** @var OrderItemInterface $item **/
foreach ($order->getItems() as $item) {
$itemsById[$item->getProductId()] = $item->getQtyOrdered();
if (!isset($itemsById[$item->getProductId()])) {
$itemsById[$item->getProductId()] = 0;
}
$itemsById[$item->getProductId()] += $item->getQtyOrdered();
}
$productSkus = $this->getSkusByProductIds->execute(array_keys($itemsById));
/** @var ItemToSellInterface[] $itemsToSell */
Expand Down

0 comments on commit 8d39f4c

Please sign in to comment.