Magento-登录后重定向用户组 [英] Magento - redirect user group after login

查看:118
本文介绍了Magento-登录后重定向用户组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Magento中将不同的用户组重定向到不同的页面?

How can I redirect different user groups to different pages in Magento ?

我要做的是为每个客户组分配一个类别,以便在登录时将用户重定向到该类别.

what I want to do is to assign a category to each customer group to redirect the user to it on login.

非常感谢.

推荐答案

这种方法怎么样:

考虑从现有模块开始,例如:

Consider starting with an existing module such as:

http://www.magentocommerce.com/magento-connect/MagePsycho/extension/3763/custom_login_redirect

然后添加您自己的逻辑.对于客户的组名称,您可以尝试以下操作:

Then adding your own logic. For the group name of a customer you can try this:

$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();

$group = Mage::getModel ('customer/group')->load($groupId)->getCode();

如果您随后按组命名了类别,则可以重定向到http://+ base_url + $ group,然后无需明确确定要加载的类别页面.

If you then have your categories named as per your groups you can do a redirect to http:// + base_url + $group therfore removing the need to explicitly work out what category page to load.

这篇关于Magento-登录后重定向用户组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆