Addresses.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
  9. use Magento\Multishipping\Model\Checkout\Type\Multishipping\State;
  10. class Addresses extends \Magento\Multishipping\Controller\Checkout implements HttpGetActionInterface
  11. {
  12. /**
  13. * Multishipping checkout select address page
  14. *
  15. * @return void
  16. */
  17. public function execute()
  18. {
  19. // If customer do not have addresses
  20. if (!$this->_getCheckout()->getCustomerDefaultShippingAddress()) {
  21. $this->_redirect('*/checkout_address/newShipping');
  22. return;
  23. }
  24. $this->_getState()->unsCompleteStep(State::STEP_SHIPPING);
  25. $this->_getState()->setActiveStep(State::STEP_SELECT_ADDRESSES);
  26. if (!$this->_getCheckout()->validateMinimumAmount()) {
  27. $message = $this->_getCheckout()->getMinimumAmountDescription();
  28. $this->messageManager->addNotice($message);
  29. }
  30. $this->_view->loadLayout();
  31. $this->_view->renderLayout();
  32. }
  33. }