{"id":374133,"date":"2023-03-27T14:41:32","date_gmt":"2023-03-27T14:41:32","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=374133"},"modified":"2023-05-26T05:48:20","modified_gmt":"2023-05-26T05:48:20","slug":"add-a-custom-customer-group-in-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/","title":{"rendered":"Add a custom Customer group in Magento 2"},"content":{"rendered":"\n<p>In this blog, we are going to learn how we can add a custom <a href=\"https:\/\/experienceleague.adobe.com\/docs\/commerce-admin\/customers\/customers-menu\/customer-groups.html?lang=en\">Customer group<\/a> in Magento 2 and assign existing customers to this newly created custom customer group.<\/p>\n\n\n\n<p>Here, in the following example, We are adding a custom Customer group in Magento 2 with the name <strong>Webkul Users, <\/strong>and adding all general group existing customers to this newly created group.<\/p>\n\n\n\n<p>Please follow the below steps to achieve the desired result.<\/p>\n\n\n\n<p><strong>Step 1:<\/strong>&nbsp;Create&nbsp;an Upgrade Data file with the name UpgardeData.php file inside <\/p>\n\n\n\n<p>the&nbsp;<strong><em>app\/code\/Vendor\/Module\/Setup\/<\/em>&nbsp;<\/strong>directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/** Webkul Software.\n *\n * @category Webkul\n * @package Webkul_CustomerGroup\n * @author Webkul\n * @copyright Webkul Software Private Limited (https:\/\/webkul.com)\n * @license https:\/\/store.webkul.com\/license.html\n *\/\n\nnamespace Vendor\\Module\\Setup;\n\nuse Magento\\Customer\\Api\\Data\\GroupInterfaceFactory;\nuse Magento\\Framework\\Setup\\ModuleContextInterface;\nuse Magento\\Framework\\Setup\\ModuleDataSetupInterface;\nuse Magento\\Framework\\Setup\\UpgradeDataInterface;\nuse Magento\\Customer\\Api\\Data\\GroupInterface;\nuse Magento\\Customer\\Api\\GroupRepositoryInterface;\nuse Magento\\Framework\\App\\Area;\nuse Magento\\Framework\\App\\State;\nuse Psr\\Log\\LoggerInterface;\nuse Magento\\Customer\\Model\\ResourceModel\\Customer\\CollectionFactory;\nuse Magento\\Customer\\Model\\GroupFactory;\n\nclass UpgradeData implements UpgradeDataInterface\n{\n    const GROUP_CODE = &#039;General&#039;;\n\n    const CUSTOM_GROUP_CODE = &#039;Webkul Users&#039;;\n\n    \/**\n     * @var GroupInterfaceFactory\n     *\/\n    private $groupInterfaceFactory;\n\n    \/**\n     * @var GroupRepositoryInterface\n     *\/\n    protected $groupRepository;\n\n    \/**\n     * @var State;\n     *\/\n    protected $state;\n    \n    \/**\n     * @var LoggerInterface\n     *\/\n    protected $logger;\n\n    \/**\n     * @var CollectionFactory\n     *\/\n    protected $collectionFactory;\n\n    \/**\n     * @var GroupFactory\n     *\/\n    protected $groupFactory;\n\n    \/**\n     * Intialize Dependencies\n     *\n     * @param GroupInterfaceFactory $groupInterfaceFactory\n     * @param GroupRepositoryInterface $groupRepository\n     * @param State $state\n     * @param LoggerInterface $logger\n     * @param CollectionFactory $collectionFactory\n     * @param GroupFactory $groupFactory\n     * @return void\n     *\/\n    public function __construct(\n        GroupInterfaceFactory $groupInterfaceFactory,\n        GroupRepositoryInterface $groupRepository,\n        State $state,\n        LoggerInterface $logger,\n        CollectionFactory $collectionFactory,\n        GroupFactory $groupFactory\n    ) {\n        $this-&gt;groupInterfaceFactory    = $groupInterfaceFactory;\n        $this-&gt;groupRepository          = $groupRepository;\n        $this-&gt;state                    = $state;\n        $this-&gt;logger                   = $logger;\n        $this-&gt;collectionFactory        = $collectionFactory;\n        $this-&gt;groupFactory             = $groupFactory;\n    }\n    \/**\n     * Function for upgrade data\n     *\n     * @param ModuleDataSetupInterface $setup\n     * @param ModuleContextInterface $context\n     * @return void\n     *\/\n    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)\n    {\n        $installer = $setup;\n        $installer-&gt;startSetup();\n        $group = $this-&gt;groupInterfaceFactory-&gt;create();\n        $group\n            -&gt;setCode(self::CUSTOM_GROUP_CODE)\n            -&gt;setTaxClassId(\\Magento\\Customer\\Model\\ResourceModel\\GroupRepository::DEFAULT_TAX_CLASS_ID);\n        $this-&gt;groupRepository-&gt;save($group);\n\n        \/** assign group to customers *\/\n        $this-&gt;assignGroupToCustomers();\n        $installer-&gt;endSetup();\n    }\n\n    \/**\n     * Function for assign group to customers\n     * @return void\n     *\/\n    public function assignGroupToCustomers()\n    {\n        try {\n            \/\/ Set the current area to adminhtml to avoid security issues\n            $this-&gt;state-&gt;setAreaCode(Area::AREA_ADMINHTML);\n            \/\/ Get the custom group by code\n\n            $customGroup = $this-&gt;groupFactory-&gt;create();\n            $customGroupId = $customGroup-&gt;load(self::CUSTOM_GROUP_CODE, &#039;customer_group_code&#039;)-&gt;getId();\n            $this-&gt;logger-&gt;info(&quot;Custom Group Id :: &quot;.$customGroupId);\n\n            \/\/ Get all general customers\n            $group = $this-&gt;groupFactory-&gt;create();\n            $groupId = $group-&gt;load(self::GROUP_CODE, &#039;customer_group_code&#039;)-&gt;getId();\n            $customerCollection = $this-&gt;collectionFactory-&gt;create();\n            $customerCollection-&gt;addFieldToFilter(&#039;group_id&#039;, $groupId);\n            foreach ($customerCollection as $customer) {\n                \/\/ Assign the custom group to the customer\n                $customer-&gt;setGroupId($customGroupId);\n                $customer-&gt;save();\n            }\n        } catch (Exception $e) {\n            $this-&gt;logger-&gt;info(&quot;Error in assign group to customers:: &quot;.$e-&gt;getMessage());\n        }\n    }\n}<\/pre>\n\n\n\n<p><strong>Step 2:<\/strong>&nbsp;Now, just run the below upgrade command.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento setup:upgrade<\/pre>\n\n\n\n<p>Now, look into the first image in which&nbsp;<strong>Webkul Users<\/strong> new group&nbsp;is being displayed in the customer groups section.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"675\" data-id=\"374143\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-1200x675.png\" alt=\"webkul-users-group\" class=\"wp-image-374143\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-1200x675.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-300x169.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-250x141.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-768x432.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group.png 1366w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n<\/figure>\n\n\n\n<p>Look into the second image, this is before the implementation of the above code. As you can see all customers are being displayed as an existing general group.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-existing-group-1200x675.png\" alt=\"customer-with-existing-group\" class=\"wp-image-374144\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-existing-group-1200x675.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-existing-group-300x169.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-existing-group-250x141.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-existing-group-768x432.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-existing-group.png 1366w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>And in the last image in which, As you can see all customers are being displayed with the newly created Webkul Users group.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"675\" data-id=\"374148\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-custom-group-1200x675.png\" alt=\"customer-with-custom-group\" class=\"wp-image-374148\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-custom-group-1200x675.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-custom-group-300x169.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-custom-group-250x141.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-custom-group-768x432.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/customer-with-custom-group.png 1366w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n<\/figure>\n\n\n\n<p>Hope this will be helpful.<\/p>\n\n\n\n<p>Thanks \ud83d\ude42<\/p>\n\n\n\n<p>You can see other blogs as well:-<\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/tag\/add-custom-product-attributes\/\">Add Custom Product Attributes<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to learn how we can add a custom Customer group in Magento 2 and assign existing customers to this newly created custom customer group. Here, in the following example, We are adding a custom Customer group in Magento 2 with the name Webkul Users, and adding all general group <a href=\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":354,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[13880,13881,13883],"class_list":["post-374133","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-customer-group-in-magento2","tag-customer-groups","tag-magento-2-customer-groups"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Add a custom Customer group in Magento 2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"we are going to learn how we can add a custom customer group in Magento 2 and assign existing customers to this newly created custom group.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add a custom Customer group in Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"we are going to learn how we can add a custom customer group in Magento 2 and assign existing customers to this newly created custom group.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-27T14:41:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-26T05:48:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-1200x675.png\" \/>\n<meta name=\"author\" content=\"Mubarik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mubarik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\"},\"author\":{\"name\":\"Mubarik\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/2fa581764e96125af674349150b2b818\"},\"headline\":\"Add a custom Customer group in Magento 2\",\"datePublished\":\"2023-03-27T14:41:32+00:00\",\"dateModified\":\"2023-05-26T05:48:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\"},\"wordCount\":201,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-1200x675.png\",\"keywords\":[\"customer group in Magento2\",\"customer groups\",\"Magento 2 customer groups\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\",\"name\":\"Add a custom Customer group in Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-1200x675.png\",\"datePublished\":\"2023-03-27T14:41:32+00:00\",\"dateModified\":\"2023-05-26T05:48:20+00:00\",\"description\":\"we are going to learn how we can add a custom customer group in Magento 2 and assign existing customers to this newly created custom group.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group.png\",\"width\":1366,\"height\":768,\"caption\":\"webkul-users-group\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add a custom Customer group in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/2fa581764e96125af674349150b2b818\",\"name\":\"Mubarik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/af8c0b8b43a042ae4d9fd3cb5207b18bbe898d7ab63344df28ac22803b26a0ee?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/af8c0b8b43a042ae4d9fd3cb5207b18bbe898d7ab63344df28ac22803b26a0ee?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Mubarik\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/md-mubarik459\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add a custom Customer group in Magento 2 - Webkul Blog","description":"we are going to learn how we can add a custom customer group in Magento 2 and assign existing customers to this newly created custom group.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/","og_locale":"en_US","og_type":"article","og_title":"Add a custom Customer group in Magento 2 - Webkul Blog","og_description":"we are going to learn how we can add a custom customer group in Magento 2 and assign existing customers to this newly created custom group.","og_url":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-03-27T14:41:32+00:00","article_modified_time":"2023-05-26T05:48:20+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-1200x675.png","type":"","width":"","height":""}],"author":"Mubarik","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Mubarik","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/"},"author":{"name":"Mubarik","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/2fa581764e96125af674349150b2b818"},"headline":"Add a custom Customer group in Magento 2","datePublished":"2023-03-27T14:41:32+00:00","dateModified":"2023-05-26T05:48:20+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/"},"wordCount":201,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-1200x675.png","keywords":["customer group in Magento2","customer groups","Magento 2 customer groups"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/","url":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/","name":"Add a custom Customer group in Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group-1200x675.png","datePublished":"2023-03-27T14:41:32+00:00","dateModified":"2023-05-26T05:48:20+00:00","description":"we are going to learn how we can add a custom customer group in Magento 2 and assign existing customers to this newly created custom group.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/webkul-users-group.png","width":1366,"height":768,"caption":"webkul-users-group"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Add a custom Customer group in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/2fa581764e96125af674349150b2b818","name":"Mubarik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/af8c0b8b43a042ae4d9fd3cb5207b18bbe898d7ab63344df28ac22803b26a0ee?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/af8c0b8b43a042ae4d9fd3cb5207b18bbe898d7ab63344df28ac22803b26a0ee?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Mubarik"},"url":"https:\/\/webkul.com\/blog\/author\/md-mubarik459\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/374133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=374133"}],"version-history":[{"count":13,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/374133\/revisions"}],"predecessor-version":[{"id":374361,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/374133\/revisions\/374361"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=374133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=374133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=374133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}