processCreateAccount(); } if (Tools::isSubmit('submitLogin')) { $this->processLogin(); } } protected function processCreateAccount() { $register_form = $this ->makeCustomerForm() ->setGuestAllowed(false) ->fillWith(Tools::getAllValues()); if ($register_form->submit()) { die(json_encode(array( 'hasError' => false, ))); } die(json_encode(array( 'hasError' => true, 'errors' => $register_form->getErrors() ))); } protected function processLogin() { $login_form = $this ->makeLoginForm() ->fillWith(Tools::getAllValues()); if ($login_form->submit()) { die(json_encode(array( 'hasError' => false, ))); } die(json_encode(array( 'hasError' => true, 'errors' => $login_form->getErrors() ))); } }