Skip to content

Commit

Permalink
If order address does not exists on previous order than do not replic…
Browse files Browse the repository at this point in the history
…ate it
  • Loading branch information
lruozzi9 committed May 23, 2023
1 parent 547bdd3 commit d827dd3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/ReorderProcessing/ReorderDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ public function process(OrderInterface $order, OrderInterface $reorder): void
$reorder->setNotes($order->getNotes());
$reorder->setLocaleCode($order->getLocaleCode());

/** @var AddressInterface $billingAddress */
$billingAddress = $order->getBillingAddress();

/** @var AddressInterface $shippingAddress */
if ($billingAddress !== null) {
$reorder->setBillingAddress(clone $billingAddress);
}
$shippingAddress = $order->getShippingAddress();
$reorder->setBillingAddress(clone $billingAddress);
$reorder->setShippingAddress(clone $shippingAddress);
if ($shippingAddress !== null) {
$reorder->setShippingAddress(clone $shippingAddress);
}
}
}

0 comments on commit d827dd3

Please sign in to comment.