ShippingPost.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Multishipping\Controller\Checkout;
  8. use Magento\Multishipping\Model\Checkout\Type\Multishipping\State;
  9. class ShippingPost extends \Magento\Multishipping\Controller\Checkout
  10. {
  11. /**
  12. * @return void
  13. */
  14. public function execute()
  15. {
  16. $shippingMethods = $this->getRequest()->getPost('shipping_method');
  17. try {
  18. $this->_eventManager->dispatch(
  19. 'checkout_controller_multishipping_shipping_post',
  20. ['request' => $this->getRequest(), 'quote' => $this->_getCheckout()->getQuote()]
  21. );
  22. $this->_getCheckout()->setShippingMethods($shippingMethods);
  23. $this->_getState()->setActiveStep(State::STEP_BILLING);
  24. $this->_getState()->setCompleteStep(State::STEP_SHIPPING);
  25. $this->_redirect('*/*/billing');
  26. } catch (\Exception $e) {
  27. $this->messageManager->addError($e->getMessage());
  28. $this->_redirect('*/*/shipping');
  29. }
  30. }
  31. }