giwrgos Posted April 18, 2014 Share Posted April 18, 2014 Hello everyone, I'm looking a way to make my life easier when a new user registered on my website. I want when a new user is creating an account on my website the system will automatically add him on the proper group. Now the new customer is waiting my approve in order to use the website. I'made this because i have to check his address and add him in the appropriate group. This process now i want to make it to be automatically. For example if the customer contains the keyword "king" in his address then add him on the Group A and if his address contains the word "queen" add him on the Group B. Does anyone know how i can do it? Thank you Link to comment Share on other sites More sharing options...
vekia Posted April 18, 2014 Share Posted April 18, 2014 hello change ID od customer group in varialble: PS_CUSTOMER_GROUP stored in ps_configuration name Link to comment Share on other sites More sharing options...
giwrgos Posted April 20, 2014 Author Share Posted April 20, 2014 yes but this is not of what i'm looking. I was thinking to have an array containing the words that i'm looking for the group A and another array with the words of Group b. Then read the address and if contains the any word from the list of A add it to the group A else check for words of the Group B. Where i can find the fields of the address before prestashop stores it to the database Link to comment Share on other sites More sharing options...
webdev0008 Posted April 20, 2014 Share Posted April 20, 2014 Hi You find the code for the address store in db at the time of registration in "processSubmitAccount" function of controllers/front/AuthController.php or you can also do this by using actionCustomerAccountAdd hook. Link to comment Share on other sites More sharing options...
vekia Posted April 20, 2014 Share Posted April 20, 2014 you can achieve it with regular expression in controller mentioned above. http://www.kirupa.com/forum/showthread.php?230003-PHP-Extract-domain-without-subdomains-from-email-address Link to comment Share on other sites More sharing options...
giwrgos Posted April 21, 2014 Author Share Posted April 21, 2014 (edited) you can achieve it with regular expression in controller mentioned above. http://www.kirupa.com/forum/showthread.php?230003-PHP-Extract-domain-without-subdomains-from-email-address Thanks but the regular expression is not what i'm looking. the solution of webdev0008 is more like what i'm looking. i can use the following if statement to determine which is the group of the user if (strpos($address,'queen') !== false) { //att to the A group } Edited April 21, 2014 by giwrgos (see edit history) Link to comment Share on other sites More sharing options...
roman.b Posted April 12, 2017 Share Posted April 12, 2017 (edited) Did you do it? I am also looking for a solution Edit: Good information, there is such a module: https://github.com/nenes25/prestashop_customerautogroups Edited April 12, 2017 by roman.b (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts