123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- /**
- *
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Multishipping\Controller\Checkout;
- use Magento\Multishipping\Model\Checkout\Type\Multishipping\State;
- use Magento\Framework\App\ResponseInterface;
- class Billing extends \Magento\Multishipping\Controller\Checkout
- {
- /**
- * Validation of selecting of billing address
- *
- * @return boolean
- */
- protected function _validateBilling()
- {
- if (!$this->_getCheckout()->getQuote()->getBillingAddress()->getFirstname()) {
- $this->_redirect('*/checkout_address/selectBilling');
- return false;
- }
- return true;
- }
- /**
- * Multishipping checkout billing information page
- *
- * @return void|ResponseInterface
- */
- public function execute()
- {
- if (!$this->_validateBilling()) {
- return;
- }
- if (!$this->_validateMinimumAmount()) {
- return;
- }
- if (!$this->_getState()->getCompleteStep(State::STEP_SHIPPING)) {
- return $this->_redirect('*/*/shipping');
- }
- $this->_getState()->setActiveStep(State::STEP_BILLING);
- $this->_view->loadLayout();
- $this->_view->renderLayout();
- }
- }
|