Zen_j1 Posted July 1, 2015 Share Posted July 1, 2015 (edited) I using prestashop 1.5.4.1 how can i auto Auto assign customer Group based on state at the time of registration If customer is from State A he should be assigned to group A once he saves his address If customer is from State B he should be assigned to group B once he saves his address so on Edited July 3, 2015 by Zen_j1 (see edit history) Link to comment Share on other sites More sharing options...
Zen_j1 Posted July 1, 2015 Author Share Posted July 1, 2015 (edited) Ok found some thing on this post https://www.prestashop.com/forums/topic/330590-adding-customers-to-groups/ Vekia explain how to add customer email to group can someone help on same principle how to add customer state (or state having ID) to group (or group having ID) In below code i understood for 1) for ID_OF_GMAIL_GROUP i have to use ID of my group , If I am correct What I should use for this list($user, $domain) = explode('@', $_POST['email']); I think $user will remain as it is correct me if I am wrong Will $State replace $domain? What will change for this part of code = explode('@', $_POST['email']); below code check for gmail, hotmail how can I just check State by ID and assign them to group By ID Vekia code code from above post 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'))); } Edited July 1, 2015 by Zen_j1 (see edit history) Link to comment Share on other sites More sharing options...
Zen_j1 Posted July 2, 2015 Author Share Posted July 2, 2015 Or how How can I auto assign group by Zone? Link to comment Share on other sites More sharing options...
Zen_j1 Posted July 3, 2015 Author Share Posted July 3, 2015 (edited) If not zones how about country I think controllers/front/AuthController.php can filer group based customer selecting country in front office if above code can filter customer based on email than it should be possible to fiter customer based on country ID and auto assign group But How ? I am not programmer but I think by repacling correct variable or little change in above code we should able to automatically group customer by country Edited July 3, 2015 by Zen_j1 (see edit history) Link to comment Share on other sites More sharing options...
Zen_j1 Posted July 4, 2015 Author Share Posted July 4, 2015 Not able to figure out how to auto assign customer to group based country can someone help? Link to comment Share on other sites More sharing options...
Zen_j1 Posted July 7, 2015 Author Share Posted July 7, 2015 Still trying to solve this Link to comment Share on other sites More sharing options...
Tine Chem Posted October 4, 2016 Share Posted October 4, 2016 Hi I am working on this problem for a while now. does anyone has a solution how to: Auto assign customer Group based on Zones or Country or States at the time registration? Is there any modeule to do this? Code modifications? T. Link to comment Share on other sites More sharing options...
webxtor Posted October 21, 2016 Share Posted October 21, 2016 This can be very simply done by, for example, overriding AddressController and processSubmitAddress function. For a small fee I can help in your particular need. Link to comment Share on other sites More sharing options...
gcaporaso Posted October 27, 2016 Share Posted October 27, 2016 Hello, I'm interested to the same module , have you a solutions ? Link to comment Share on other sites More sharing options...
rytiz2873 Posted November 4, 2016 Share Posted November 4, 2016 Hi! i almost made this module and it would be good to hear from all of you, what should module do when there is more than one address OR if customer delete his only address and creates new address - should i also check that? 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