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 abc@xxx.com, group named xxx allot to him or if he has abc@yyy.in, group "yyy" allot to him开发者_如何学编程.
Please suggest me ..how can I accomplish this task or please refer any document.
Thanks!
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.
精彩评论