Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpdateShippingMethods.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  public function execute()
17  {
18  try {
19  $this->_initCheckout();
20  $this->_checkout->prepareOrderReview($this->_initToken());
21  $this->_view->loadLayout('paypal_express_review');
22 
23  $this->getResponse()->setBody(
24  $this->_view
25  ->getLayout()
26  ->getBlock('express.review.shipping.method')
27  ->setQuote($this->_getQuote())
28  ->toHtml()
29  );
30  return;
31  } catch (\Magento\Framework\Exception\LocalizedException $e) {
32  $this->messageManager->addExceptionMessage(
33  $e,
34  $e->getMessage()
35  );
36  } catch (\Exception $e) {
37  $this->messageManager->addExceptionMessage(
38  $e,
39  __('We can\'t update shipping method.')
40  );
41  }
42  $this->getResponse()->setBody(
43  '<script>window.location.href = ' . $this->_url->getUrl('*/*/review') . ';</script>'
44  );
45  }
46 }
__()
Definition: __.php:13