Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing which group a customer belongs to in Magento

Tags:

magento

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?

like image 610
Dan Temple Avatar asked Feb 11 '12 17:02

Dan Temple


People also ask

How do I change the customer group in Magento 2?

To change this setting, navigate to Stores > Settings > Configuration > Customers > Customer Configuration > Create New Account Options from your backend administrative dashboard.

How many customer groups does Magento provide?

Out of the box, Magento comes with three default customer groups: General, Not Logged In and Wholesale, but creating additional customer groups is very quick and easy.


1 Answers

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();
}
like image 145
Ovidiu Avatar answered Oct 04 '22 03:10

Ovidiu