Skip to content

Commit

Permalink
Update Orders.php
Browse files Browse the repository at this point in the history
fix for order cancellation not working when extendOrder is missing.
  • Loading branch information
jm-extend committed Jan 5, 2024
1 parent e5763ac commit 395af1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Model/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,16 @@ public function cancel($order)
$extendOrder = $this->extendOrderRepository->get($order->getId());
} catch (NoSuchEntityException $e) {
$this->logger->info(__("Extend Order %1 was not found", $order->getId()));
$extendOrder = false;
} catch (Exception $e) {
throw new LocalizedException(__('Order cancelation was failed:' . $e->getMessage()));
$extendOrder = false;
}

$this->getOrderRequest($order->getStoreId())
if ($extendOrder){
$this->getOrderRequest($order->getStoreId())
->cancel($extendOrder->getExtendOrderId());
}
}

/**
Expand Down

0 comments on commit 395af1f

Please sign in to comment.