Address.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Multishipping\Controller\Checkout;
  7. /**
  8. * Multishipping checkout address manipulation controller
  9. */
  10. abstract class Address extends \Magento\Framework\App\Action\Action
  11. {
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function dispatch(\Magento\Framework\App\RequestInterface $request)
  16. {
  17. if (!$this->_getCheckout()->getCustomer()->getId()) {
  18. return $this->_redirect('customer/account/login');
  19. }
  20. return parent::dispatch($request);
  21. }
  22. /**
  23. * Retrieve multishipping checkout model
  24. *
  25. * @return \Magento\Multishipping\Model\Checkout\Type\Multishipping
  26. */
  27. protected function _getCheckout()
  28. {
  29. return $this->_objectManager->get(\Magento\Multishipping\Model\Checkout\Type\Multishipping::class);
  30. }
  31. /**
  32. * Retrieve checkout state model
  33. *
  34. * @return \Magento\Multishipping\Model\Checkout\Type\Multishipping\State
  35. */
  36. protected function _getState()
  37. {
  38. return $this->_objectManager->get(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::class);
  39. }
  40. }