Rissinko Posted January 3, 2016 Share Posted January 3, 2016 Hi I am looking for working solution for function that add new registered customers to the groups by mail @domain... I tried this solution but it doesn't work on prestashop 1.6.1. Therefore i trying create post here. Link to comment Share on other sites More sharing options...
vekia Posted January 4, 2016 Share Posted January 4, 2016 the workflow to achieve it will be:1) extract domain name from customer email 2) check grups if group with selected name exists 3) create new group if doesnt exist 4) assign customer to group it is achievable with module (with account register hook) and also with customization of prestashop core Link to comment Share on other sites More sharing options...
Rissinko Posted January 5, 2016 Author Share Posted January 5, 2016 Hi Vekia. I know the workflow because first what i tried was this solution from you ... but it doesn't work for me on version 1.6.1.0 There is big chance that something has change from 2014 in this registration process... and I do not know very well the process of registration in PrestaShop so I can't figure it out. vekia, on 16 May 2014 - 10:48 PM, said: okay, so in file controllers/front/AuthController.php you can find code like: $customer->addGroups(array((int)Configuration::get('PS_CUSTOMER_GROUP')));change it to: list($user, $domain) = explode('@', $_POST['email']);if ($domain == 'gmail.com') {$customer->addGroups(array(ID_OF_GMAIL_GROUP)); } elseif ($domain =='hotmail.com' ) {$customer->addGroups(array(ID_OF_HOTMAIL_GROUP)); } else {$customer->addGroups(array((int)Configuration::get('PS_CUSTOMER_GROUP'))); }if code above is not clear for your, let me know i will explain 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