42 parent::__construct($context);
52 $result = $this->orderLoader->load($this->_request);
56 $order = $this->_coreRegistry->registry(
'current_order');
58 $resultRedirect = $this->resultRedirectFactory->create();
61 $cart = $this->_objectManager->get(\
Magento\Checkout\Model\Cart::class);
66 }
catch (\
Magento\Framework\Exception\LocalizedException $e) {
67 if ($this->_objectManager->get(\
Magento\Checkout\Model\Session::class)->getUseNotice(
true)) {
68 $this->messageManager->addNoticeMessage($e->getMessage());
70 $this->messageManager->addErrorMessage($e->getMessage());
72 return $resultRedirect->setPath(
'*/*/history');
73 }
catch (\Exception $e) {
74 $this->messageManager->addExceptionMessage(
76 __(
'We can\'t add this item to your shopping cart right now.')
78 return $resultRedirect->setPath(
'checkout/cart');
83 return $resultRedirect->setPath(
'checkout/cart');
__construct(Action\Context $context, OrderLoaderInterface $orderLoader, Registry $registry)