I am making a project In which I have to differentiate between the user who have registered I want that if some one registered with the id
abc@gmail.com
He should be automatically assign to student group
and if user registered with the id other then this
gmail.com
then He should be assign to a group say Guest
So can any one tell me. where I have to start for this as I search alot but can not get answer related to this
Best Answer
you can do this by magento
event Observer
and find a trigger anobserver
oncustomer save events
and change customer group accordingly.You can try with this two Event
customer_save_before
customer_save_after
First of all ,i
guess
that you havealready create customer groups
Student,Guest from Admin>Customers>Customer group.Find details on event and observer
here
Model Approach
Step1: trigger an event on basic of
customer_save_before
Step2: Magento
Observer Code is below
and guess thatguest custome group id is 2,Student is 5
.See another example How to automatically send a transactional email on customer group change?