PHP
PHP

Reputation: 1709

Allot customer group according to their email id

In a magento project I need to allot customer group to customer according to their email id. Like I have customer group in admin "xxx" and "yyy" NOw I want at time of signup if user have id [email protected], group named xxx allot to him or if he has [email protected], group "yyy" allot to him.

Please suggest me ..how can I accomplish this task or please refer any document.

Thanks!

Upvotes: 1

Views: 265

Answers (1)

clockworkgeek
clockworkgeek

Reputation: 37700

The most likely way to succeed is to override Mage_Customer_Model_Customer and provide your own getGroupId() method. This method should check the domain of the email address ($this->getEmail()) and then both set and return the ID of the group. If it doesn't recognise the domain then pass it back to the parent to be processed as normal.

Upvotes: 2

Related Questions