3

I'm not sure how to programmatically add customer to one of previously created customer groups when he/she registers.

There are 2 groups:

  1. General customer - basic group
  2. Regular customer - customer needs to be added there if he/she requests a regular customer card

I need to add a customer to the latter group programmatically. Any ideas?

7

There is two way to achieve this functionality :

  1. Call the event customer_register_success and change the user group just after registration.

Follow this solution : Set customer group from customer registration form

  1. Create a stand alone page where you have to get customer collection according to your filter condition and set the new user group and save the customer.
  • This link correspond to the Magento 1 but question is about the Magento 2 – Siarhey Uchukhlebau Nov 9 '16 at 11:09
  • @SiarheyUchukhlebau, check updated answer – Ashish Jagnani Nov 9 '16 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.