try { $page =
$this->accountEditOrderPageLoader->
load($request,
$context);
} catch (OrderException
$exception) { $this->
addFlash(self::DANGER,
$this->
trans('error.' .
$exception->
getErrorCode(),
['%orderNumber%' =>
$order->
getOrderNumber()]));
return $this->
redirectToRoute('frontend.account.order.page'
);
} $this->
hook(new AccountEditOrderPageLoadedHook($page,
$context));
if ($page->
isPaymentChangeable() === false
) { $refundsEnabled =
$this->systemConfigService->
get('core.cart.enableOrderRefunds'
);
if ($refundsEnabled) { $this->
addFlash(self::DANGER,
$this->
trans('account.editOrderPaymentNotChangeableWithRefunds'
));
} else { $this->
addFlash(self::DANGER,
$this->
trans('account.editOrderPaymentNotChangeable'
));
} } $page->
setErrorCode($request->
get('error-code'
));