根据电子邮件 ID 分配客户组
在 magento 项目中,我需要根据客户的电子邮件 ID 将客户组分配给客户。 就像我在管理员“xxx”和“yyy”中有客户组 现在我想在注册时如果用户有 id [email protected],名为 xxx 的群组分配给他,或者如果他有[电子邮件受保护],则群组“yyy”分配给他。
请建议我..我怎样才能完成这项任务或请参考任何文件。
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最有可能成功的方法是重写
Mage_Customer_Model_Customer
并提供您自己的getGroupId()
方法。此方法应检查电子邮件地址的域 ($this->getEmail()
),然后设置并返回组的 ID。如果它无法识别该域,则将其传回父级以正常进行处理。The most likely way to succeed is to override
Mage_Customer_Model_Customer
and provide your owngetGroupId()
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.