/** * {@inheritdoc} */ protected function _toHtml() { if (!$this->_customerHelper->isRegistrationAllowed() || $this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) { return ''; } return parent::_toHtml(); }
/** * Customer register form page * * @return void */ public function execute() { if ($this->_getSession()->isLoggedIn() || !$this->customerHelper->isRegistrationAllowed()) { $this->_redirect('*/*'); return; } $this->_view->loadLayout(); $this->_view->getLayout()->initMessages(); $this->_view->renderLayout(); }
/** * Is registration allowed * * @return bool */ protected function isRegistrationAllowed() { return $this->_customerHelperData->isRegistrationAllowed(); }