Jump to content

Recommended Posts

Hi,

I am trying to add users with particular email id are automatically added into the same group.

For example users having account in gmail should come under the GMAIL group created by me in prestashop. Is that possible in prestashop or should I have to add the functionality in the source???

 

Thanks in advance.

Link to comment
Share on other sites

Hi vekia,

 

Okay..!

 

For your question,

Yes, I want to assingn to new customers. Cuz i have a plan in my mind to restrict offers to customers in selected groups. Let me get this straight , if i have a deal with a company named xxxx, then the employees in that company who have id in the format [email protected]/+, they all should come under the group xxxx.

 

Thanks.

Link to comment
Share on other sites

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

  • 1 year later...

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

 

Hi Vekia

 

Should this work in 1.6.0.6?

 

I tried and it didn't work. It looks quite simple but it's not working.

Link to comment
Share on other sites

×
×
  • Create New...