How to create New Customer Group programmatically in Magento 2

0

Magento 2 allows users to classify customers into groups in which they are allocated with the similar criteria. This function helps you to control the customers effectively as you can explore different marketing strategies and apply different policies, for example, you can set up different offers for different market segments. This can help you to promote the customers’ satisfaction and commitment to your services. Additionally, this function of Magento 2 also allows you to set the tax class for each group of customers.

By default, Magento 2 has some customers groups such as General, Wholesales, Not Login (Guests). Users, however, can easily create new customer groups to match their operational strategy. This tutorial will guide you through the process to create new customer groups in Magento 2.

Create customer group via backend

  1. Login to the back end of your Magento 2 store.
  2. From the Admin sidebar, navigate to Stores > Other Settings > Customer Groups.
  3. Hit the Add New Customer Group button on the upper right corner of the page.

4. In the box of Group Name, enter the name for each group to identify it. Keep in mind that the maximum character number is 32.

In the section of Tax Class Field, choose the one to apply for the whole group.

5. Click Save Customer Group to complete the creation.

That comes to the end of the tutorial. If you get any issues during the applying process, please let us know by writing your comments below.

Programmatically create customer group

You can use the following code to programmatically create customer group

Rate this post

Share.

About Author

Daniel is a Magento developer with 5 years of experience with customizing Magento extensions, Magento templates. He's main author at Magento explorer

Leave A Reply