Wednesday , September 28 2016
Home >> All tutorial >> Get Customer Group within Magento

Get Customer Group within Magento

Magento is built to work with different groups of users/customers.

You can easily find out what group the customer belongs to by the snippet below.

// Mage_Customer_Session
$session = Mage::getSingleton('customer/session');

// Get the Customer Group ID.
$group_id = $session->getCustomerGroupId();

// Get the Group Name the Customer is part of.
$group_name = Mage::getModel('customer/group')->load($group_id)->getCode();

Note: Customers must be log in.

You can check whether a customer is logged in by simply,
if($session->isLoggedIn()) {

// Customer is logged in :)

} else {

// Not logged in :(

}

--- Updated News ---

Here we go with the new generation of Magento 2 extensions, after its official release on 17 November 2015. Within the next technology of Magento 2, we expect better extensions for our E-commerce website, including of Magento 2 One Step Checkout, Magento 2 Gift Card and Magento 2 Affiliate. Having all these 3 products will help your store rocket the sales.

magento 2 one step checkout

About Champ

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>