Get Customer Group from Session

Using the customer group is a good way to restrict and change parts of your Magento store when a customer is logged in. A good example of this is if you are wanting to put restrictions in or show alternative banners based on a Wholesaler customer login. To get the customer group id from the current session we can use the code below:

A quick example of using this code in our template would be to show a different banner for trade customers on the homepage:

Unknown source


Leave a reply