Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Overview.php
Go to the documentation of this file.
1 <?php
8 
12 use Psr\Log\LoggerInterface;
13 
15 {
21  public function execute()
22  {
23  if (!$this->_validateMinimumAmount()) {
24  return;
25  }
26 
27  $this->_getState()->setActiveStep(State::STEP_OVERVIEW);
28 
29  try {
30  $payment = $this->getRequest()->getPost('payment', []);
31  if (!empty($payment)) {
32  $payment['checks'] = [
33  AbstractMethod::CHECK_USE_FOR_COUNTRY,
34  AbstractMethod::CHECK_USE_FOR_CURRENCY,
35  AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX,
36  AbstractMethod::CHECK_ZERO_TOTAL,
37  ];
38  $this->_getCheckout()->setPaymentMethod($payment);
39  }
40  $this->_getState()->setCompleteStep(State::STEP_BILLING);
41 
42  $this->_view->loadLayout();
43  $this->_view->renderLayout();
44  } catch (LocalizedException $e) {
45  $this->messageManager->addError($e->getMessage());
46  $this->_redirect('*/*/billing');
47  } catch (\Exception $e) {
48  $this->_objectManager->get(LoggerInterface::class)->critical($e);
49  $this->messageManager->addException($e, __('We cannot open the overview page.'));
50  $this->_redirect('*/*/billing');
51  }
52  }
53 }
_redirect($path, $arguments=[])
Definition: Action.php:167
__()
Definition: __.php:13
$payment
Definition: order.php:17