From 8c444597714df0ed417cdbaee28ca4ae9d31d2d7 Mon Sep 17 00:00:00 2001 From: cloudjibao Date: Wed, 1 Mar 2017 13:24:49 +1000 Subject: [PATCH] Update ShipmentFactory.php Changed the call to getId() to getProductId(). getId() returns the order ID instead of the product Id --- app/code/Magento/Sales/Model/Order/ShipmentFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/ShipmentFactory.php b/app/code/Magento/Sales/Model/Order/ShipmentFactory.php index 0d177d0c003e6..b84c13acc3850 100644 --- a/app/code/Magento/Sales/Model/Order/ShipmentFactory.php +++ b/app/code/Magento/Sales/Model/Order/ShipmentFactory.php @@ -132,8 +132,8 @@ protected function prepareItems( $qty = 1; } } else { - if (isset($items[$orderItem->getId()])) { - $qty = min($items[$orderItem->getId()], $orderItem->getQtyToShip()); + if (isset($items[$orderItem->getProductId()])) { + $qty = min($items[$orderItem->getProductId()], $orderItem->getQtyToShip()); } elseif (!count($items)) { $qty = $orderItem->getQtyToShip(); } else {