Billing.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. use Magento\Framework\App\ResponseInterface;
  10. class Billing extends \Magento\Multishipping\Controller\Checkout
  11. {
  12. /**
  13. * Validation of selecting of billing address
  14. *
  15. * @return boolean
  16. */
  17. protected function _validateBilling()
  18. {
  19. if (!$this->_getCheckout()->getQuote()->getBillingAddress()->getFirstname()) {
  20. $this->_redirect('*/checkout_address/selectBilling');
  21. return false;
  22. }
  23. return true;
  24. }
  25. /**
  26. * Multishipping checkout billing information page
  27. *
  28. * @return void|ResponseInterface
  29. */
  30. public function execute()
  31. {
  32. if (!$this->_validateBilling()) {
  33. return;
  34. }
  35. if (!$this->_validateMinimumAmount()) {
  36. return;
  37. }
  38. if (!$this->_getState()->getCompleteStep(State::STEP_SHIPPING)) {
  39. return $this->_redirect('*/*/shipping');
  40. }
  41. $this->_getState()->setActiveStep(State::STEP_BILLING);
  42. $this->_view->loadLayout();
  43. $this->_view->renderLayout();
  44. }
  45. }