Home » Magento, Magento 24 January 2017

Magento 2: Get Customer Groups

This article shows how to get all customer groups name and id in Magento 2.

I will be showing an example in a Block class. You can write the code in other class (Helper/Model) as well.

Here is the code that you need to write in your Block class.

The output array while calling getCustomerGroups() method will be something like this:

Hope this helps. Thanks.

Magento 2

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed

Comments are closed.