Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Review.php
Go to the documentation of this file.
1 <?php
8 
10 
12 {
18  public function execute()
19  {
20  try {
21  $this->_initCheckout();
22  $this->_checkout->prepareOrderReview($this->_initToken());
23  $this->_view->loadLayout();
24  $reviewBlock = $this->_view->getLayout()->getBlock('paypal.express.review');
25  $reviewBlock->setQuote($this->_getQuote());
26  $reviewBlock->getChildBlock('details')->setQuote($this->_getQuote());
27  if ($reviewBlock->getChildBlock('shipping_method')) {
28  $reviewBlock->getChildBlock('shipping_method')->setQuote($this->_getQuote());
29  }
30  $this->_view->renderLayout();
31  return;
32  } catch (\Magento\Framework\Exception\LocalizedException $e) {
33  $this->messageManager->addExceptionMessage(
34  $e,
35  $e->getMessage()
36  );
37  } catch (\Exception $e) {
38  $this->messageManager->addExceptionMessage(
39  $e,
40  __('We can\'t initialize Express Checkout review.')
41  );
42  }
43 
45  $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
46  return $resultRedirect->setPath('checkout/cart');
47  }
48 }
__()
Definition: __.php:13