NewShipping.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\Address;
  8. class NewShipping extends \Magento\Multishipping\Controller\Checkout\Address
  9. {
  10. /**
  11. * Create New Shipping address Form
  12. *
  13. * @return void
  14. */
  15. public function execute()
  16. {
  17. $this->_getState()->setActiveStep(
  18. \Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SELECT_ADDRESSES
  19. );
  20. $this->_view->loadLayout();
  21. if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) {
  22. $addressForm->setTitle(
  23. __('Create Shipping Address')
  24. )->setSuccessUrl(
  25. $this->_url->getUrl('*/*/shippingSaved')
  26. )->setErrorUrl(
  27. $this->_url->getUrl('*/*/*')
  28. );
  29. $this->_view->getPage()->getConfig()->getTitle()->set(
  30. $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault()
  31. );
  32. if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) {
  33. $addressForm->setBackUrl($this->_url->getUrl('*/checkout/addresses'));
  34. } else {
  35. $addressForm->setBackUrl($this->_url->getUrl('*/cart/'));
  36. }
  37. }
  38. $this->_view->renderLayout();
  39. }
  40. }