Skip to content

Commit

Permalink
MAGETWO-56938: CLONE - [Github] API salesOrderRepositoryV1 can't crea…
Browse files Browse the repository at this point in the history
…te shipping address #5544
  • Loading branch information
irenelagno committed Oct 5, 2016
1 parent 0b88cae commit f2dec80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/code/Magento/Sales/Model/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ public function save(\Magento\Sales\Api\Data\OrderInterface $entity)
$extensionAttributes = $entity->getExtensionAttributes();
if ($entity->getIsNotVirtual() && $extensionAttributes && $extensionAttributes->getShippingAssignments()) {
$shippingAssignments = $extensionAttributes->getShippingAssignments();
if (count($shippingAssignments) === 1) {
$shipping = $shippingAssignments[0]->getShipping();
if (!empty($shippingAssignments)) {
$shipping = array_shift($shippingAssignments)->getShipping();
$entity->setShippingAddress($shipping->getAddress());
$entity->setShippingMethod($shipping->getMethod());
}
Expand Down

0 comments on commit f2dec80

Please sign in to comment.