Skip to content

Commit f2dec80

Browse files
committed
MAGETWO-56938: CLONE - [Github] API salesOrderRepositoryV1 can't create shipping address #5544
1 parent 0b88cae commit f2dec80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/Sales/Model/OrderRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ public function save(\Magento\Sales\Api\Data\OrderInterface $entity)
150150
$extensionAttributes = $entity->getExtensionAttributes();
151151
if ($entity->getIsNotVirtual() && $extensionAttributes && $extensionAttributes->getShippingAssignments()) {
152152
$shippingAssignments = $extensionAttributes->getShippingAssignments();
153-
if (count($shippingAssignments) === 1) {
154-
$shipping = $shippingAssignments[0]->getShipping();
153+
if (!empty($shippingAssignments)) {
154+
$shipping = array_shift($shippingAssignments)->getShipping();
155155
$entity->setShippingAddress($shipping->getAddress());
156156
$entity->setShippingMethod($shipping->getMethod());
157157
}

0 commit comments

Comments
 (0)