getRequest()->getParam('isAjax'); $this->_initCheckout(); $this->_checkout->updateShippingMethod($this->getRequest()->getParam('shipping_method')); if ($isAjax) { $this->_view->loadLayout('paypal_express_review_details', true, true, false); $this->getResponse()->setBody( $this->_view->getLayout()->getBlock('page.block')->setQuote($this->_getQuote())->toHtml() ); return; } } catch (\Magento\Framework\Exception\LocalizedException $e) { $this->messageManager->addExceptionMessage( $e, $e->getMessage() ); } catch (\Exception $e) { $this->messageManager->addExceptionMessage( $e, __('We can\'t update shipping method.') ); } if ($isAjax) { $this->getResponse()->setBody( '' ); } else { $this->_redirect('*/*/review'); } } }