Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Register.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  public function execute()
17  {
18  if ($this->_objectManager->get(\Magento\Customer\Model\Session::class)->isLoggedIn()) {
19  $this->getResponse()->setRedirect($this->_getHelper()->getMSCheckoutUrl());
20  return;
21  }
22 
23  $this->_view->loadLayout();
24 
25  $registerForm = $this->_view->getLayout()->getBlock('customer_form_register');
26  if ($registerForm) {
27  $registerForm->setShowAddressFields(
28  true
29  )->setBackUrl(
30  $this->_getHelper()->getMSLoginUrl()
31  )->setSuccessUrl(
32  $this->_getHelper()->getMSShippingAddressSavedUrl()
33  )->setErrorUrl(
34  $this->_url->getCurrentUrl()
35  );
36  }
37 
38  $this->_view->renderLayout();
39  }
40 }