Skip to content

Commit 2a4162a

Browse files
Rizwan KhanRizwan Khan
authored andcommitted
AC-11376: Cart API enhancements
1 parent 849eca1 commit 2a4162a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

app/code/Magento/Quote/Plugin/ValidateQuoteOrigOrder.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,10 @@ public function beforeSave(
5555
$params = $this->request->getBodyParams();
5656
if (!empty($params) && isset($params['quote']['orig_order_id'])) {
5757
$orderId = $params['quote']['orig_order_id'];
58-
try {
59-
$order = $this->orderRepository->get($orderId);
60-
$orderCustomer = (int)$order->getCustomerId();
61-
if ($quote->getCustomerId() !== $orderCustomer) {
62-
throw new NoSuchEntityException(__('Please check input parameters.'));
63-
}
64-
} catch (\Exception $e) {
65-
throw new NoSuchEntityException(__('Please check input parameters.'), $e);
58+
$order = $this->orderRepository->get($orderId);
59+
$orderCustomer = (int)$order->getCustomerId();
60+
if ($quote->getCustomerId() !== $orderCustomer) {
61+
throw new NoSuchEntityException(__('Please check input parameters.'));
6662
}
6763
}
6864
}

0 commit comments

Comments
 (0)