nasreddine hafidi Posted June 21, 2022 Share Posted June 21, 2022 hello, i need to approve new user registration by the admin, before they can login in Link to comment Share on other sites More sharing options...
Ress Posted June 21, 2022 Share Posted June 21, 2022 Rather than develop this functionality, I think it is more advantageous to buy a module that does this, there are quite a few to choose from. https://addons.prestashop.com/en/search?search_query=customer approve Link to comment Share on other sites More sharing options...
PrestaHeroes USA Posted June 21, 2022 Share Posted June 21, 2022 (edited) The first module I ever wrote years ago for 1.4 and have maintained since, Private Shop Authorized Client Only https://addons.prestashop.com/en/private-sales-flash-sales/28906-private-shop-authorized-clients-only.html Edited June 21, 2022 by El Patron (see edit history) Link to comment Share on other sites More sharing options...
Knowband Plugins Posted June 21, 2022 Share Posted June 21, 2022 If you want to automatic disable the customer after the registrtaion and customer can only login after admin activate that customer from admin, then you can do that by adding the below code in "classes/form/CustomerForm.php" , submit() Replace try { $ok = $this->customerPersister->save( $this->getCustomer(), $clearTextPassword, $newPassword, $this->passwordRequired ); } catch (PrestaShopException $e) { $this->errors[''][] = $this->translator->trans('Could not update your information, please check your data.', [], 'Shop.Notifications.Error'); $ok = false; } with try { $ok = $this->customerPersister->save( $this->getCustomer(), $clearTextPassword, $newPassword, $this->passwordRequired ); $emailField = $this->getField('email'); $id_customer = Customer::customerExists($emailField->getValue(), true, true); $kb_customer_obj = new Customer($id_customer); $kb_customer_obj->active = 0; $kb_customer_obj->save(); } catch (PrestaShopException $e) { $this->errors[''][] = $this->translator->trans('Could not update your information, please check your data.', [], 'Shop.Notifications.Error'); $ok = false; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now