显示客户在Magento中属于哪个组 [英] Showing which group a customer belongs to in Magento

查看:74
本文介绍了显示客户在Magento中属于哪个组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Magento中设置了几个客户组(常规,已启用采购订单),我想知道这是否易于在客户的帐户区域中显示给客户,以便他们可以看到他们属于哪个组? /p>

I have set up a couple of Customer Groups in Magento (General, Purchase Order Enabled) and i’m wondering if this is easy to display to the customer in their account area so they can see which group they belong to?

推荐答案

也许@MagePsycho是从旧版本获得的,但在1.5上,您需要更改组模型.

Maybe @MagePsycho got it from an old version but on 1.5 you need to change the group model.

// Check Customer is loggedin or not
if(Mage::getSingleton('customer/session')->isLoggedIn()){
      // Get group Id
      $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
      //Get customer Group name
      $group = Mage::getModel('customer/group')->load($groupId);
      echo $group->getCode();
}

这篇关于显示客户在Magento中属于哪个组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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