{"id":22880,"date":"2019-07-17T17:15:02","date_gmt":"2019-07-17T15:15:02","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=22880"},"modified":"2023-11-01T14:08:30","modified_gmt":"2023-11-01T12:08:30","slug":"how-to-create-customer-groups-in-magento","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html","title":{"rendered":"How to Create Customer Groups in Magento?"},"content":{"rendered":"\n<p><span style=\"font-weight: 400\">What are Magento customer groups and what value do they hold for a store admin? How to manage customer groups from admin panel and what changes can be made programmatically? Read on to find out.&nbsp;<\/span><\/p>\n<p><!--more--><\/p>\n<p><span style=\"font-weight: 400\">No matter how large or small your online store is, you will have a certain number of customers that can not be unmanaged &ndash; unless you want the chaos to rule your ecommerce. What is more, it is important to create on-site marketing and promotional and involve customers into them.&nbsp; Yet, the larger your online shop becomes, the less convenient it is to manage your clients manually. But Magento ecommerce platform offers a wonderful way out &ndash; customer groups.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Explore our article and learn what are Magento customer groups and how to manage them.&nbsp; Also, discover the extension we created to introduce an individual customer group feature. And finally, find out top 3 Magento customer groups extensions worth implementing into your ecommerce.<\/span><\/p>\n<p><b>Table of contents:<\/b><\/p>\n<p><a href=\"#step_1\">What are customer groups in Magento?<br>\n<\/a><a href=\"#step_2\">How to create customer groups in Magento?<br>\n<\/a><a href=\"#step_3\">How to set customer group pricing in Magento?<br>\n<\/a><a href=\"#step_4\">Top 3 Magento customer group extensions<br>\n<\/a><a href=\"#step_5\">How to create customer groups programmatically in Magento 2<br>\n<\/a><a href=\"#step_6\">How to assign a customer to a group programmatically<br>\n<\/a><a href=\"#step_7\">How to delete the customer group programmatically<br>\n<\/a><a href=\"#step_8\">How to set Group Price programmatically<\/a><\/p>\n<h2 id=\"step_1\">What are customer groups in Magento?<\/h2>\n<p><span style=\"font-weight: 400\">Being an advanced ecommerce solution, Magento comes with a set of comprehensive back office configurations that provides for the majority needs of businesses of all scales. The functionality that we will explore in this article and that is a wonderfully useful addition to the basic ecommerce customer management features are customer groups.&nbsp;&nbsp;&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">Magento back office allows to divide online store customers into more specific categories, called Magento customer groups. Magento 2 customer group behavior can be managed and controlled by the store admin, which allows, with application of specific extensions or custom development, to create a differentiated shopping experience for each client. Magento customer groups can be set up and modified in the store back office, but this means you get access to the default functionality only. Also, you can install a customer group extension or create a module of your own to implement the more advanced customer groups functionality.<\/span><\/p>\n<p><span style=\"font-weight: 400\">For instance, it is possible to divide customers into groups and assign different product prices for each, creating a multi-tiered pricing policy. This was only one example of how customer groups can upgrade your customer management, but you do not have to stick to this one and be creative in your application of Magento 2 customer groups.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Here are some ideas on how to use customer groups in Magento:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Devise a multi-stage promotion program and assign distinct promotion percentages or various perks like shipping and &ldquo;buy X, get Y for free&rdquo; to different customer groups&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Show different tax rates for customer groups at your Magento storefront, with lower rates &ndash; for the registered users or ones who are on the loyalty program, and higher rates &ndash; for the unregistered and first-time customers. This will be a great encouragement for those who do not have an account at your store, to start one.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Offer different shipping provisions to different customer groups in Magento as a method of additional promotion (bear in mind this is not an in-built functionality).<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">All in all, it is obvious Magento customer groups functionality have a wide potential, and how you will realize it depends solely on your needs and imagination.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Now, after we have explored what are customer groups in Magento, it is high time we considered ways and means of working with them &ndash; both in online store back office and programmatically.&nbsp;<\/span><\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/magento-development\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Development<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento development<\/p><a href=\"https:\/\/belvg.com\/magento-development\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n<h2 id=\"step_2\">How to create customer groups in Magento?<\/h2>\n<p><span style=\"font-weight: 400\">Now let us explore how and where to set customer groups in Magento. The customer group configuration in admin panel is rather simple and can be performed in several easy steps.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #1<\/strong>: log in to your Magento back office and navigate to Customers -&gt; Customer Groups.<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/customers-customer-groups.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter wp-image-22882 size-full\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/customers-customer-groups.png\" alt=\"customers customer groups\" width=\"316\" height=\"301\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #2<\/strong>: press Add New Customer Group button in the upper right corner.<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/add-new-customer-group-magento.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22883\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/add-new-customer-group-magento.png\" alt=\"add new customer group magento\" width=\"1281\" height=\"533\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #3<\/strong>: enter the new customer group name and assign it a tax class, then press Save Customer Group button.<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22884\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group.png\" alt=\"new customer group\" width=\"1281\" height=\"374\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p><span style=\"font-weight: 400\">Now let us move to other configurations and explore where to set customer groups in Magento.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #4<\/strong>: navigate to Customers -&gt; All customers.<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/customers-all-customers.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22885\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/customers-all-customers.png\" alt=\"customers all customers\" width=\"318\" height=\"299\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #5<\/strong>: select the customer profiles you want to assign groups to.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #6<\/strong>: expand the Action drop down on the left and select Assign a customer group.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/assign-a-customer-group.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22886\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/assign-a-customer-group.png\" alt=\"assign a customer group\" width=\"1280\" height=\"393\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #7<\/strong>: choose the customer group you wish to assign and press OK at the popup screen.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The selected customer will be assigned to the group you chose.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Now it is time we demonstrated how to apply Magento customer groups on practice. The most common way to put customer groups into practice is to set customer group pricing.<\/span><\/p>\n<div class=\"content_sales_info\" style=\"background-image: url(https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/03\/Sales_background.png\"><img width=\"65\" height=\"65\" src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/03\/Igor-Dragun1.png\" alt=\"Igor Dragun\" title=\"How to Create Customer Groups in Magento?\"><div class=\"content_part\"><h3 class=\"title\">Partner With Us <\/h3><span class=\"sales_content_text\">Let's discuss how to grow your business. Get a Free Quote.<\/span><\/div> <a class=\"call-to-action\" href=\"https:\/\/belvg.com\/contact?utm_source=blog&amp;utm_campaign=sales_block&amp;utm_content=middle\" target=\"_blank\" rel=\"noopener\">Talk to Igor<\/a><\/div>\n<h2 id=\"step_3\">How to set customer group pricing in Magento?<\/h2>\n<p><span style=\"font-weight: 400\">Magento offers two similar functionalities that allow to set differentiated prices &ndash; catalog rules and group pricings, and with both you can achieve similar results. So, how to choose which you should apply in this or that situation? It is wiser to implement catalog rules to the whole categories of products or the entire store, while group price is more useful when applied per product basis and for a certain group of customers.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Below is a step-by-step instructions on how to set up customer group pricing in Magento back office.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #1<\/strong>: navigate to Catalog -&gt; Products&nbsp;<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-14.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22905\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-14.png\" alt=\"new customer group 14\" width=\"325\" height=\"224\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #2<\/strong>: select the product you want to set a tiered price for and open it in the Edit mode.<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-13.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22906\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-13.png\" alt=\"new customer group 13\" width=\"1281\" height=\"646\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #3<\/strong>: press Advanced Pricing caption below the Price field.<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/advanced-pricing-select-magento-customer-groups.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22904\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/advanced-pricing-select-magento-customer-groups.png\" alt=\"advanced pricing select magento customer groups\" width=\"1257\" height=\"719\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\"><strong>Step #4<\/strong>: fill in the following fields:<\/span><\/p>\n<p><span style=\"font-weight: 400\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22903\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/advanced-pricing-magento-customer-groups.png\" alt=\"advanced pricing magento\" width=\"1281\" height=\"730\" title=\"How to Create Customer Groups in Magento?\"><\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400\">Special Price<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Special Price From &ndash; the date range special price is valid&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Cost<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Website and Customer Group the special price will apply to<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Manufacturer&rsquo;s Suggested Retail Price&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Display Actual Price<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">When finished, press Done in the upper right corner.<\/span><\/p>\n<p><span style=\"font-weight: 400\">This is basically it for Magento 2 customer groups configuration capabilities in the back office. Want to extend them and wield more advanced features, but do not have Magento developer&rsquo;s experience? You can either install a customer groups extension or turn to the BelVG team for <\/span><a href=\"https:\/\/belvg.com\/magento-development\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">Magento custom development services<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<div class=\"content_sales_info\" style=\"background-image: url(https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/03\/Sales_background.png\"><img width=\"65\" height=\"65\" src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/03\/Igor-Dragun1.png\" alt=\"Igor Dragun\" title=\"How to Create Customer Groups in Magento?\"><div class=\"content_part\"><h3 class=\"title\">Partner With Us <\/h3><span class=\"sales_content_text\">Let's discuss how to grow your business. Get a Free Quote.<\/span><\/div> <a class=\"call-to-action\" href=\"https:\/\/belvg.com\/contact?utm_source=blog&amp;utm_campaign=sales_block&amp;utm_content=middle\" target=\"_blank\" rel=\"noopener\">Talk to Igor<\/a><\/div>\n<h2 id=\"step_4\">Top 3 Magento customer group extensions<\/h2>\n<p><span style=\"font-weight: 400\">Do not have enough time on your hands or Magento experience to introduce the much-needed features into your customer management toolkit? We selected the top 3 Magento customer groups extensions for you to introduce the needed changes quickly and without effort.&nbsp;<\/span><\/p>\n<p><b><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/shipping_payment_by_customer_groups.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy size-full wp-image-22887 alignleft\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/shipping_payment_by_customer_groups.png\" alt=\"shipping_payment_by_customer_groups\" width=\"62\" height=\"62\" title=\"How to Create Customer Groups in Magento?\"><\/a>Shipping &amp; Payment By Customer Groups<\/b><span style=\"font-weight: 400\">. This Magento 2 extension allows to restrict payment and shipping methods to a certain customer group in your online store. With Shipping &amp; Payment By Customer Groups extension, you will be able to align shipping and payment with your promotion and marketing strategies as well as ecommerce business needs. Even the unregistered customers will not be left unattended &ndash; this extension covers for them as well.<\/span><span style=\"font-weight: 400\"><br>\n<\/span><b>Compatibility<\/b><span style=\"font-weight: 400\">: Community 2.1, 2.2, Enterprise 2.1, 2.2<\/span><span style=\"font-weight: 400\"><br>\n<\/span><b>Price<\/b><span style=\"font-weight: 400\">: $139.00<\/span><\/p>\n<p><b><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/customer-groups-advanced-management.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy alignleft wp-image-22888 size-thumbnail\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/customer-groups-advanced-management-150x150.png\" alt=\"customer groups advanced management\" width=\"150\" height=\"150\" title=\"How to Create Customer Groups in Magento?\"><\/a>Customer Groups Advanced Management<\/b><span style=\"font-weight: 400\">. This extension allows the store admin to create and configure various types of customer groups with parent and child accounts. It also allows enables you to add unique registration blocks to new customer groups and link customer groups with each other. All in all, Customer Groups Advanced Management creates a welcoming environment for basic and advanced customer groups configurations.<br>\n<\/span><b>Compatibility<\/b><span style=\"font-weight: 400\">: Community 2.2, 2.3, Enterprise 2.2, 2.3<\/span><span style=\"font-weight: 400\"><br>\n<\/span><b>Price<\/b><span style=\"font-weight: 400\">: $199.00<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/customer-groups-shipping.payment-restrictions-240x240_2-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy alignleft size-thumbnail wp-image-22889\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/customer-groups-shipping.payment-restrictions-240x240_2-1-150x150.png\" alt=\"customer-groups-shipping.payment-restrictions-240x240_2 (1)\" width=\"150\" height=\"150\" title=\"How to Create Customer Groups in Magento?\"><\/a>Customer Groups Shipping &amp; Payment Restrictions<\/b><span style=\"font-weight: 400\">. This Magento customer groups extension is similar to the one we explored first, but the key difference is that this one is compatible with solely Magento Community and,&nbsp; consequently, costs twice as little. This extension allows to introduce shipping and payment restrictions for various customer groups from the Magento back office and hide the restricted methods from the storefront.<br>\n<\/span><b>Compatibility<\/b><span style=\"font-weight: 400\">: Community 2.2, 2.3<\/span><span style=\"font-weight: 400\"><br>\n<\/span><b>Price<\/b><span style=\"font-weight: 400\">: $69.00<\/span><\/p>\n<p><span style=\"font-weight: 400\">Did not find the Magento extension that suits your needs? Visit our Magento store and explore our outstanding Magento addons!<\/span><\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/store.belvg.com\/\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/05\/Magento-store.belvg_.com_.png\" width=\"481\" height=\"480\" alt=\"Magento store.belvg.com\" class=\"module_image\" title=\"How to Create Customer Groups in Magento?\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Extensions<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento extensions<\/p><a href=\"https:\/\/store.belvg.com\/\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the store<\/span><\/a><\/div><\/div><\/div>\n<h2 id=\"step_5\">How to create customer groups programmatically in Magento 2<\/h2>\n<p><span style=\"font-weight: 400\">In order to create a Magento customer group programmatically, we developed an extension from scratch &ndash; <\/span><a href=\"https:\/\/github.com\/belvg-public\/magento2-customer-group-sample\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">BelVG_CustomerGroupCLI.<\/span><\/a><span style=\"font-weight: 400\"> In this paragraph, we will not describe the whole process, so if you are new to Magento development, we strongly advise you to first explore <\/span><a href=\"https:\/\/belvg.com\/blog\/general-module-structure-in-magento-2.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">Magento 2 Module Structure<\/span><\/a><span style=\"font-weight: 400\"> article to get a grasp of all the base module files.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">The adding of a new customer group is implemented in the <strong>execute()<\/strong> method, located at the <em>path_to_the_root_magento\/vendor\/magento\/module-<\/em><\/span><span style=\"font-weight: 400\"><em>customer\/Controller\/Adminhtml\/Group\/Save.php<\/em> in Magento_Customer module.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In our custom Magento module, new customer group installation will be carried out via CLI commands (to learn more about CLI commands, follow the link to the article <\/span><a href=\"https:\/\/belvg.com\/blog\/magento-2-console-commands.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">Magento 2 console commands<\/span><\/a><span style=\"font-weight: 400\">).&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">Before we create a new customer group, first we need to specify a tax class for it (to learn how to add a new tax class via admin panel, visit <\/span><a href=\"https:\/\/belvg.com\/blog\/how-to-set-up-taxes-in-magento-2-a-complete-step-by-step-instruction.html#step_5\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">https:\/\/belvg.com\/blog\/how-to-set-up-taxes-in-magento-2-a-complete-step-by-step-instruction.html#step_5<\/span><\/a> <span style=\"font-weight: 400\">). For this, we create two CLI commands, the first to view the existing tax classes, the second &ndash; to create new tax classes.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">Then we add the classes that realize our commands into <em>BelVG\/CustomerGroupCLI\/etc\/di.xml<\/em><\/span><\/p>\n<pre class=\"lang:default decode:true \">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n        xsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager\/etc\/config.xsd\"&gt;\r\n    &lt;type name=\"Magento\\Framework\\Console\\CommandList\"&gt;\r\n        &lt;arguments&gt;\r\n            &lt;argument name=\"commands\" xsi:type=\"array\"&gt;\r\n                &lt;item name=\"tax_class_show\" xsi:type=\"object\"&gt;\r\n                    BelVG\\CustomerGroupCLI\\Console\\Command\\TaxClassShowCommand\r\n                &lt;\/item&gt;\r\n                &lt;item name=\"tax_class_create\" xsi:type=\"object\"&gt;\r\n                    BelVG\\CustomerGroupCLI\\Console\\Command\\TaxClassCreateCommand\r\n                &lt;\/item&gt;\r\n            &lt;\/argument&gt;\r\n        &lt;\/arguments&gt;\r\n    &lt;\/type&gt;\r\n&lt;\/config&gt;\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Implementation of the <em>BelVG\\CustomerGroupCLI\\Console\\Command\\TaxClassShowCommand<\/em> class.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">We are going to save the existing tax classes, and in order to save them for later, we can apply <em>\\Magento\\Tax\\Model\\TaxClass\\Source\\Customer<\/em>. We should use <strong>getAllOptions()<\/strong> method to pass and extract the existing tax classes for processing.<\/span><\/p>\n<pre class=\"lang:default decode:true \">protected function execute(InputInterface $input, OutputInterface $output)\r\n    {\r\n        try {\r\n            $taxClasses = $this-&gt;taxClass-&gt;getAllOptions();\r\n            $tableRows = [];\r\n            foreach ($taxClasses as $taxClass) {\r\n                $tableRows[] = [$taxClass['value'], $taxClass['label']];\r\n            }\r\n\r\n            $table = new Table($output);\r\n            $table\r\n                -&gt;setHeaders(['Id', 'Name'])\r\n                -&gt;setRows($tableRows);\r\n            $table-&gt;render();\r\n\r\n            return \\Magento\\Framework\\Console\\Cli::RETURN_SUCCESS;\r\n        } catch (\\Exception $e) {\r\n            $output-&gt;writeln('&lt;error&gt;' . $e-&gt;getMessage() . '&lt;\/error&gt;');\r\n            if ($output-&gt;getVerbosity() &gt;= OutputInterface::VERBOSITY_VERBOSE) {\r\n                $output-&gt;writeln($e-&gt;getTraceAsString());\r\n            }\r\n\r\n            return \\Magento\\Framework\\Console\\Cli::RETURN_FAILURE;\r\n        }\r\n    }\r\n<\/pre>\n<p>Implementation of the execute method of&nbsp;<em>BelVG\\CustomerGroupCLI\\Console\\Command\\TaxClassCreateCommand<\/em> class that creates the new tax class.<\/p>\n<pre class=\"lang:default decode:true \">protected function execute(InputInterface $input, OutputInterface $output)\r\n    {\r\n        try {\r\n            $taxClassName = $input-&gt;getOption(self::NAME);\r\n\r\n            $taxClassModel = $this-&gt;taxClassModelFactory-&gt;create();\r\n            $newTaxClassId = $taxClassModel\r\n                -&gt;setClassName($taxClassName)\r\n                -&gt;setClassType(\\Magento\\Tax\\Model\\ClassModel::TAX_CLASS_TYPE_CUSTOMER)\r\n                -&gt;save()\r\n                -&gt;getId();\r\n\r\n            $message = '&lt;info&gt;New tax customer class '. $taxClassName . ' has been created with ID = ' . $newTaxClassId . '&lt;\/info&gt;';\r\n            $output-&gt;writeln($message);\r\n\r\n            return \\Magento\\Framework\\Console\\Cli::RETURN_SUCCESS;\r\n        } catch (\\Exception $e) {\r\n            $output-&gt;writeln('&lt;error&gt;' . $e-&gt;getMessage() . '&lt;\/error&gt;');\r\n            if ($output-&gt;getVerbosity() &gt;= OutputInterface::VERBOSITY_VERBOSE) {\r\n                $output-&gt;writeln($e-&gt;getTraceAsString());\r\n            }\r\n\r\n            return \\Magento\\Framework\\Console\\Cli::RETURN_FAILURE;\r\n        }\r\n    }\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Install our module and execute the bin\/magento setup:upgrade command.<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter wp-image-22913 size-full\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-1.png\" alt=\"new customer group\" width=\"988\" height=\"107\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>To see the parameters needed for command execution, use the bin\/magento tax:class:create &ndash;help command.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22891\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-2.png\" alt=\"new customer group 2\" width=\"1241\" height=\"278\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>Add new tax class bin\/magento tax:class:create &ndash;tax_class_name=&rdquo;BelVG Tax Name&rdquo;.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22892\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-3.png\" alt=\"new customer group 3\" width=\"964\" height=\"56\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>See the existing tax classes with the bin\/magento tax:class:show command.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-4-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22894\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-4-1.png\" alt=\"new customer group 4\" width=\"513\" height=\"108\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>Now lets define new item for creating Customer Group itself. This update is done in the di.xml as well:<\/p>\n<pre class=\"lang:default decode:true \">&lt;item name=\"customer_group_create\" xsi:type=\"object\"&gt;\r\n    BelVG\\CustomerGroupCLI\\Console\\Command\\CustomerGroupCreateCommand\r\n&lt;\/item&gt;\r\n<\/pre>\n<p>Create the class that implements interaction with CLI user&nbsp; <em>BelVG\\CustomerGroupCLI\\Console\\Command\\CustomerGroupCreateCommand<\/em>.<\/p>\n<pre class=\"lang:default decode:true \"> protected function configure()\r\n    {\r\n        $this\r\n            -&gt;setName('customer:group:create')\r\n            -&gt;setDescription('Create new customer group')\r\n            -&gt;setDefinition($this-&gt;getOptionsList());\r\n    }\r\n\r\n    protected function execute(InputInterface $input, OutputInterface $output)\r\n    {\r\n        try {\r\n            $output-&gt;writeln('&lt;info&gt;Creating new Customer group...&lt;\/info&gt;');\r\n            $this-&gt;customerGroupHelper-&gt;setData($input);\r\n            $customerGroupId = $this-&gt;customerGroupHelper-&gt;execute();\r\n            $output-&gt;writeln('');\r\n            $output-&gt;writeln('&lt;info&gt;Customer Group has been created&lt;\/info&gt;');\r\n            $output-&gt;writeln('&lt;comment&gt;Customer Group Code: '\r\n                . $input-&gt;getOption(\\BelVG\\CustomerGroupCLI\\Helper\\CustomerGroup::KEY_CODE));\r\n            $output-&gt;writeln('&lt;comment&gt;Customer Group tax class Id: '\r\n                . $input-&gt;getOption(\\BelVG\\CustomerGroupCLI\\Helper\\CustomerGroup::KEY_TAX_CLASS_ID));\r\n            $output-&gt;writeln('&lt;comment&gt;Customer Group Id: ' . $customerGroupId);\r\n        } catch (\\Exception $e) {\r\n            $output-&gt;writeln('');\r\n            $output-&gt;writeln('&lt;error&gt;' . $e-&gt;getMessage() . '&lt;\/error&gt;');\r\n        }\r\n    }\r\n\r\n    \/**\r\n     * @return array\r\n     *\/\r\n    protected function getOptionsList()\r\n    {\r\n        return [\r\n            new InputOption(\\BelVG\\CustomerGroupCLI\\Helper\\CustomerGroup::KEY_CODE, null, InputOption::VALUE_REQUIRED,\r\n                '(Required) Code for new customer group. '),\r\n            new InputOption(\\BelVG\\CustomerGroupCLI\\Helper\\CustomerGroup::KEY_TAX_CLASS_ID, null,\r\n                InputOption::VALUE_REQUIRED,\r\n                '(Required) Tax customer class ID. Use commands tax:class:show and tax:class:create'),\r\n        ];\r\n    }\r\n<\/pre>\n<p>To create a new Customer Group, first, create the <em>BelVG\/CustomerGroupCLI\/Helper\/CustomerGroup.php<\/em> class. Then, in the newly created class, we perform the data installation for the new customer group and create the group itself.<\/p>\n<pre class=\"lang:default decode:true \">class CustomerGroup extends \\Magento\\Framework\\App\\Helper\\AbstractHelper\r\n{\r\n    \/**  *\/\r\n    const KEY_CODE = 'code';\r\n\r\n    \/**  *\/\r\n    const KEY_TAX_CLASS_ID = 'tax-class-id';\r\n\r\n    \/** @var  \\Symfony\\Component\\Console\\Input\\InputInterface *\/\r\n    protected $data;\r\n\r\n    \/** @var \\Magento\\Customer\\Model\\GroupFactory *\/\r\n    protected $groupFactory;\r\n\r\n    public function __construct(\r\n        \\Magento\\Customer\\Model\\GroupFactory $groupFactory,\r\n        Context $context\r\n    ) {\r\n        $this-&gt;groupFactory = $groupFactory;\r\n        parent::__construct($context);\r\n    }\r\n\r\n    public function setData(\\Symfony\\Component\\Console\\Input\\InputInterface $input)\r\n    {\r\n        $this-&gt;data = $input;\r\n        return $this;\r\n    }\r\n\r\n    \/**\r\n     * @throws \\Exception\r\n     *\/\r\n    public function execute()\r\n    {\r\n        $customerGroup = $this-&gt;groupFactory-&gt;create();\r\n        $customerGroupId = $customerGroup\r\n            -&gt;setCode($this-&gt;data-&gt;getOption(self::KEY_CODE))\r\n            -&gt;setTaxClassId($this-&gt;data-&gt;getOption(self::KEY_TAX_CLASS_ID))\r\n            -&gt;save()\r\n            -&gt;getId();\r\n\r\n        return $customerGroupId;\r\n    }\r\n}\r\n<\/pre>\n<p>Select the suitable tax class id and execute the bin\/magento customer:group:create command.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22895\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-5.png\" alt=\"new customer group 5\" width=\"1134\" height=\"285\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>Now we can see the newly created group in admin panel by navigating to CUSTOMERS-&gt;Customer Groups.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-6.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22896\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-6.png\" alt=\"new customer group 6\" width=\"1332\" height=\"584\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<h2 id=\"step_6\">How to assign a customer to a group programmatically<\/h2>\n<p>Add a new command to di.xml.<\/p>\n<pre class=\"lang:default decode:true \">&lt;item name=\"customer_assign_group\" xsi:type=\"object\"&gt;\r\n    BelVG\\CustomerGroupCLI\\Console\\Command\\CustomerAssignGroupCommand\r\n&lt;\/item&gt;<\/pre>\n<p>Create the class that implements the command <em>BelVG\/CustomerGroupCLI\/Console\/Command\/CustomerAssignGroupCommand.php.&nbsp;<\/em>To assign a customer to the group we have to set the user Id and the group Id.<\/p>\n<pre class=\"lang:default decode:true \"> const USER_ID = 'user-id';\r\n    const GROUP_ID = 'group-id';\r\n<\/pre>\n<p>In the <strong>execute<\/strong> method that implements assigning customer to the group, we refer <strong>$customerId<\/strong> and install a new <strong>$customerGroupId<\/strong> customer group for it.<\/p>\n<pre class=\"lang:default decode:true \">protected function execute(InputInterface $input, OutputInterface $output)\r\n{\r\n    try {\r\n        $customerId = $input-&gt;getOption(self::USER_ID);\r\n        $customerGroupId = $input-&gt;getOption(self::GROUP_ID);\r\n        $customerGroup = $this-&gt;groupRepository-&gt;getById($customerGroupId);\r\n\r\n        $customer = $this-&gt;customerRepository-&gt;getById($customerId);\r\n        $customer-&gt;setGroupId($customerGroupId);\r\n        $this-&gt;customerRepository-&gt;save($customer);\r\n\r\n        $message = '&lt;info&gt;Customer Group for customer ' . $customer-&gt;getFirstname() . ' ' . $customer-&gt;getLastname()\r\n            . ' has been changed to ' . $customerGroup-&gt;getCode() . '&lt;\/info&gt;';\r\n        $output-&gt;writeln($message);\r\n\r\n        return \\Magento\\Framework\\Console\\Cli::RETURN_SUCCESS;\r\n    } catch (\\Exception $e) {\r\n        $output-&gt;writeln('&lt;error&gt;' . $e-&gt;getMessage() . '&lt;\/error&gt;');\r\n        if ($output-&gt;getVerbosity() &gt;= OutputInterface::VERBOSITY_VERBOSE) {\r\n            $output-&gt;writeln($e-&gt;getTraceAsString());\r\n        }\r\n\r\n        return \\Magento\\Framework\\Console\\Cli::RETURN_FAILURE;\r\n    }\r\n}\r\n<\/pre>\n<p>Execute the command.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-7.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22897\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-7.png\" alt=\"new customer group 7\" width=\"932\" height=\"62\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>Check the result.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-8.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22898\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-8.png\" alt=\"new customer group 8\" width=\"513\" height=\"249\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<h2 id=\"step_7\">How to delete the customer group programmatically<\/h2>\n<p>Add a new command into di.xml<\/p>\n<pre class=\"lang:default decode:true \">&lt;item name=\"customer_group_delete\" xsi:type=\"object\"&gt;\r\n    BelVG\\CustomerGroupCLI\\Console\\Command\\CustomerGroupDeleteCommand\r\n&lt;\/item&gt;\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Create the class that executes the command&nbsp;<\/span><span style=\"font-weight: 400\"><em>BelVG\/CustomerGroupCLI\/Console\/Command\/CustomerGroupDeleteCommand.php<\/em>.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">We have to set group id for deleting.<\/span><\/p>\n<pre class=\"lang:default decode:true \">const GROUP_ID = 'group-id';\r\n<\/pre>\n<p>For deleting a group we will be using customer group repository class (<em>Magento\\Customer\\Api\\CustomerRepositoryInterface<\/em>).<\/p>\n<pre class=\"lang:default decode:true \">protected function execute(InputInterface $input, OutputInterface $output)\r\n{\r\n    try {\r\n        $customerGroupId = $input-&gt;getOption(self::GROUP_ID);\r\n        $customerGroup = $this-&gt;groupRepository-&gt;getById($customerGroupId);\r\n        $this-&gt;groupRepository-&gt;delete($customerGroup);\r\n\r\n        $message = '&lt;info&gt;Customer group ' . $customerGroup-&gt;getCode() . ' has been deleted&lt;\/info&gt;';\r\n        $output-&gt;writeln($message);\r\n\r\n        return \\Magento\\Framework\\Console\\Cli::RETURN_SUCCESS;\r\n    } catch (\\Exception $e) {\r\n        $output-&gt;writeln('&lt;error&gt;' . $e-&gt;getMessage() . '&lt;\/error&gt;');\r\n        if ($output-&gt;getVerbosity() &gt;= OutputInterface::VERBOSITY_VERBOSE) {\r\n            $output-&gt;writeln($e-&gt;getTraceAsString());\r\n        }\r\n\r\n        return \\Magento\\Framework\\Console\\Cli::RETURN_FAILURE;\r\n    }\r\n}\r\n<\/pre>\n<p>Check the result.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-9.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22899\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-9.png\" alt=\"new customer group 9\" width=\"1320\" height=\"564\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<h2 id=\"step_8\">How to set Group Price programmatically<\/h2>\n<p>For setting the Customer Group price from class that implements the CLI command we have to emulate area code. Use for it<br>\n\\Magento\\Framework\\App\\State method emulateAreaCode.<\/p>\n<p>Add new command to the di.xml<\/p>\n<pre class=\"lang:default decode:true \">&lt;item name=\"product_set_tier_price\" xsi:type=\"object\"&gt;\r\n    BelVG\\CustomerGroupCLI\\Console\\Command\\ProductSetTierPriceCommand\r\n&lt;\/item&gt;\r\n<\/pre>\n<p>Create the class <em>BelVG\\CustomerGroupCLI\\Console\\Command\\ProductSetTierPriceCommand<\/em> that implements this command. For setting product tier price, we can reuse <strong>add()<\/strong> method from<br>\n<em>\\Magento\\Catalog\\Api\\ScopedProductTierPriceManagementInterface<\/em>. We have to pass product<br>\nSKU and <em>\\Magento\\Catalog\\Api\\Data\\ProductTierPriceInterface<\/em>.<\/p>\n<pre class=\"lang:default decode:true \">protected function execute(InputInterface $input, OutputInterface $output)\r\n{\r\n    try {\r\n        $this-&gt;state-&gt;emulateAreaCode('adminhtml', function () use ($input, $output){\r\n            $productSku = (string)$input-&gt;getOption(self::PRODUCT_SKU);\r\n            $priceValue = (float)$input-&gt;getOption(self::PRICE_VALUE);\r\n            $productQty = (float)$input-&gt;getOption(self::PRODUCT_QTY);\r\n            $customerGroupId = (int)$input-&gt;getOption(self::CUSTOMER_GROUP_ID);\r\n\r\n            \/** @var \\Magento\\Catalog\\Api\\Data\\ProductTierPriceInterface $productTierPrice *\/\r\n            $productTierPrice = $this-&gt;productTierPriceFactory-&gt;create();\r\n\r\n            $productTierPrice-&gt;setCustomerGroupId($customerGroupId);\r\n            $productTierPrice-&gt;setValue($priceValue);\r\n            $productTierPrice-&gt;setQty($productQty);\r\n            $this-&gt;productTierPriceManagement-&gt;add($productSku, $productTierPrice);\r\n\r\n            $message = '&lt;info&gt;Tier price '. number_format($priceValue, 2) .' for product with SKU =  ' . $productSku . ' has been  added.&lt;\/info&gt;';\r\n            $output-&gt;writeln($message);\r\n\r\n            return \\Magento\\Framework\\Console\\Cli::RETURN_SUCCESS;\r\n        });\r\n    } catch (\\Exception $e) {\r\n        $output-&gt;writeln('&lt;error&gt;' . $e-&gt;getMessage() . '&lt;\/error&gt;');\r\n        $output-&gt;write($e-&gt;getTraceAsString());\r\n        if ($output-&gt;getVerbosity() &gt;= OutputInterface::VERBOSITY_VERBOSE) {\r\n            $output-&gt;writeln($e-&gt;getTraceAsString());\r\n        }\r\n\r\n        return \\Magento\\Framework\\Console\\Cli::RETURN_FAILURE;\r\n    }\r\n}\r\n<\/pre>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-10.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22900\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-10.png\" alt=\"new customer group 10\" width=\"1257\" height=\"363\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>Execute the command.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-11.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22901\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-11.png\" alt=\"new customer group 11\" width=\"1411\" height=\"75\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p>Check the result.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-12.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-22902\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/new-customer-group-12.png\" alt=\"new customer group 12\" width=\"1322\" height=\"701\" title=\"How to Create Customer Groups in Magento?\"><\/a><\/p>\n<p><span style=\"font-weight: 400\">You can download the module that implements all these commands from <\/span><a href=\"https:\/\/github.com\/belvg-public\/magento2-customer-group-sample\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">https:\/\/github.com\/belvg-public\/magento2-customer-group-sample<\/span><\/a><span style=\"font-weight: 400\">. Feel free to fork and improve it.&nbsp;<\/span><\/p>\n<h2>Wrapping it up<\/h2>\n<p><span style=\"font-weight: 400\">We hope that this article was useful for both store admins and developers who were looking for answers or advice on Magento customer groups. In this article, we explored in detail what Magento 2 customer groups are and how useful they are to build successful ecommerce. We also explored the ways to configure them from Magento back office and shared our custom module for customer groups. We believe that our insights on how we created a Magento customer groups module will serve as an inspiration for you. Finally, we covered top 3 Magento customer groups extensions, with which you can introduce additional features to your customer management techniques.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">If you have any questions or comments, feel free to leave them down below.&nbsp;<\/span><\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/magento-integration\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><div class=\"module_content_part\"><h3 class=\"title\">Magento 2 Integration<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento integration<\/p><a href=\"https:\/\/belvg.com\/magento-integration\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"What are Magento customer groups and what value do they hold for a store admin? &#8230;","protected":false},"author":50,"featured_media":22881,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,491,389,541],"tags":[],"class_list":["post-22880","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-magento","category-magento-2","category-magento2-development","category-magento-business-software-integration","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Find out 3 best Magento customer groups extensions and learn how to create Magento customer groups extension\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Oleg Semenov\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#article\",\"name\":\"How to Create Customer Groups in Magento? | BelVG Blog\",\"headline\":\"How to Create Customer Groups in Magento?\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/oleg-semenov#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/how-to-create-customer-groups-in-Magento.png\",\"width\":1108,\"height\":590,\"caption\":\"how to create customer groups in Magento\"},\"datePublished\":\"2019-07-17T17:15:02+02:00\",\"dateModified\":\"2023-11-01T14:08:30+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#webpage\"},\"articleSection\":\"Magento, Magento 2, Magento 2 Development, Magento Business Software Integration, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"position\":2,\"name\":\"Magento\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#listItem\",\"name\":\"How to Create Customer Groups in Magento?\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#listItem\",\"position\":3,\"name\":\"How to Create Customer Groups in Magento?\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/oleg-semenov#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/oleg-semenov\",\"name\":\"Oleg Semenov\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/316f0b410659190b56484ecdb7a98dce16a901ebe753c233c0f407ba96e81b1a?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Oleg Semenov\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html\",\"name\":\"How to Create Customer Groups in Magento? | BelVG Blog\",\"description\":\"Find out 3 best Magento customer groups extensions and learn how to create Magento customer groups extension\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/oleg-semenov#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/oleg-semenov#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/how-to-create-customer-groups-in-Magento.png\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html\\\/#mainImage\",\"width\":1108,\"height\":590,\"caption\":\"how to create customer groups in Magento\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-create-customer-groups-in-magento.html#mainImage\"},\"datePublished\":\"2019-07-17T17:15:02+02:00\",\"dateModified\":\"2023-11-01T14:08:30+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Create Customer Groups in Magento? | BelVG Blog","description":"Find out 3 best Magento customer groups extensions and learn how to create Magento customer groups extension","canonical_url":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#article","name":"How to Create Customer Groups in Magento? | BelVG Blog","headline":"How to Create Customer Groups in Magento?","author":{"@id":"https:\/\/belvg.com\/blog\/author\/oleg-semenov#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/how-to-create-customer-groups-in-Magento.png","width":1108,"height":590,"caption":"how to create customer groups in Magento"},"datePublished":"2019-07-17T17:15:02+02:00","dateModified":"2023-11-01T14:08:30+02:00","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#webpage"},"articleSection":"Magento, Magento 2, Magento 2 Development, Magento Business Software Integration, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","position":2,"name":"Magento","item":"https:\/\/belvg.com\/blog\/category\/magento","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#listItem","name":"How to Create Customer Groups in Magento?"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#listItem","position":3,"name":"How to Create Customer Groups in Magento?","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/oleg-semenov#author","url":"https:\/\/belvg.com\/blog\/author\/oleg-semenov","name":"Oleg Semenov","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/316f0b410659190b56484ecdb7a98dce16a901ebe753c233c0f407ba96e81b1a?s=96&d=mm&r=g","width":96,"height":96,"caption":"Oleg Semenov"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#webpage","url":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html","name":"How to Create Customer Groups in Magento? | BelVG Blog","description":"Find out 3 best Magento customer groups extensions and learn how to create Magento customer groups extension","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/oleg-semenov#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/oleg-semenov#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/07\/how-to-create-customer-groups-in-Magento.png","@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html\/#mainImage","width":1108,"height":590,"caption":"how to create customer groups in Magento"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html#mainImage"},"datePublished":"2019-07-17T17:15:02+02:00","dateModified":"2023-11-01T14:08:30+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"22880","title":"How to Create Customer Groups in Magento? | #site_title","description":"Find out 3 best Magento customer groups extensions and learn how to create Magento customer groups extension","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:36:40","updated":"2026-11-03 18:36:40"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento\" title=\"Magento\">Magento<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Create Customer Groups in Magento?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento","link":"https:\/\/belvg.com\/blog\/category\/magento"},{"label":"How to Create Customer Groups in Magento?","link":"https:\/\/belvg.com\/blog\/how-to-create-customer-groups-in-magento.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/22880","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/50"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=22880"}],"version-history":[{"count":2,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/22880\/revisions"}],"predecessor-version":[{"id":27769,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/22880\/revisions\/27769"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/22881"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=22880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=22880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=22880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}