{"id":389624,"date":"2023-07-04T15:18:04","date_gmt":"2023-07-04T15:18:04","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=389624"},"modified":"2023-07-18T09:38:48","modified_gmt":"2023-07-18T09:38:48","slug":"how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/","title":{"rendered":"How to add category column with filter to the Admin product grid in Magento 2"},"content":{"rendered":"\n<p>As per the magento functionality, we can assign multiple categories to products. By default, you can not filter the products on the basis of categories. So today we will learn how to add a category column with a <a href=\"https:\/\/store.webkul.com\/magento2-layered-navigation.html\" target=\"_blank\" rel=\"noreferrer noopener\">filter<\/a> to the <a href=\"https:\/\/store.webkul.com\/magento2-product-grid-editor.html\" target=\"_blank\" rel=\"noreferrer noopener\">product grid<\/a>. <\/p>\n\n\n\n<p>Here we will use the webkul sample module. <a href=\"https:\/\/webkul.com\/blog\/magento-development-01-module-registration\/\">https:\/\/webkul.com\/blog\/magento-development-01-module-registration\/<\/a><\/p>\n\n\n\n<p>Step 1 :- Webkul\/BlogManager\/view\/adminhtml\/ui_component\/product_listing.xml<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; ?&gt;\n&lt;listing xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd&quot;&gt;\n     &lt;listingToolbar name=&quot;listing_top&quot;&gt;\n         &lt;filters name=&quot;listing_filters&quot;&gt;\n            &lt;filterSelect name=&quot;category_id&quot; provider=&quot;${ $.parentName }&quot; component=&quot;Magento_Ui\/js\/form\/element\/ui-select&quot; template=&quot;ui\/grid\/filters\/elements\/ui-select&quot;&gt;\n                &lt;settings&gt;\n                    &lt;options class=&quot;Webkul\\BlogManager\\Model\\Category\\Categorylist&quot;\/&gt;\n                    &lt;caption translate=&quot;true&quot;&gt;Select...&lt;\/caption&gt;\n                    &lt;label translate=&quot;true&quot;&gt;Category&lt;\/label&gt;\n                    &lt;dataScope&gt;category_id&lt;\/dataScope&gt;\n                &lt;\/settings&gt;\n            &lt;\/filterSelect&gt;\n        &lt;\/filters&gt;\n    &lt;\/listingToolbar&gt;\n    &lt;columns name=&quot;product_columns&quot; class=&quot;Magento\\Catalog\\Ui\\Component\\Listing\\Columns&quot;&gt;\n        &lt;column name=&quot;category_id&quot; class=&quot;Webkul\\BlogManager\\Ui\\Component\\Listing\\Column\\Category&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;options&quot; xsi:type=&quot;object&quot;&gt;Webkul\\BlogManager\\Model\\Category\\Categorylist&lt;\/item&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;add_field&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n                    &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Categories&lt;\/item&gt;\n                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;number&quot;&gt;75&lt;\/item&gt;\n                    &lt;item name=&quot;dataType&quot; xsi:type=&quot;string&quot;&gt;select&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/column&gt;\n    &lt;\/columns&gt;\n&lt;\/listing&gt;<\/pre>\n\n\n\n<p>Step 2 :- Webkul\/BlogManager\/Ui\/Component\/Listing\/Column\/Category.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\BlogManager\\Ui\\Component\\Listing\\Column;\n\nuse Magento\\Framework\\View\\Element\\UiComponentFactory;\nuse Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface;\nuse Magento\\Framework\\Api\\SearchCriteriaBuilder;\nuse Magento\\Framework\\UrlInterface;\nclass Category extends \\Magento\\Ui\\Component\\Listing\\Columns\\Column\n{\n    \/**\n     * Constructor.\n     *\n     * @param ContextInterface   $context\n     * @param UiComponentFactory $uiComponentFactory\n     * @param SearchCriteriaBuilder $criteria\n     * @param \\Magento\\Catalog\\Model\\ProductFactory $product\n     * @param \\Magento\\Catalog\\Model\\CategoryFactory $category\n     * @param  UrlInterface $urlBuilder\n     * @param array $data\n     *\/\n    public function __construct(\n        ContextInterface $context,\n        UiComponentFactory $uiComponentFactory,\n        SearchCriteriaBuilder $criteria,\n        \\Magento\\Catalog\\Model\\ProductFactory $product,\n        \\Magento\\Catalog\\Model\\CategoryFactory $category,\n        UrlInterface $urlBuilder,\n        array $components = &#091;],\n        array $data = &#091;])\n    {\n        $this-&gt;_urlBuilder = $urlBuilder;\n        $this-&gt;_searchCriteria = $criteria;\n        $this-&gt;product = $product;\n        $this-&gt;category = $category;\n        parent::__construct($context, $uiComponentFactory, $components, $data);\n    }\n    public function prepareDataSource(array $dataSource)\n    {\n        $fieldName = $this-&gt;getData(&#039;name&#039;);\n        if (isset($dataSource&#091;&#039;data&#039;]&#091;&#039;items&#039;])) {\n            foreach ($dataSource&#091;&#039;data&#039;]&#091;&#039;items&#039;] as &amp; $item) {\n                $productId = $item&#091;&#039;entity_id&#039;];\n                $product = $this-&gt;product-&gt;create()-&gt;load($productId);\n                $cats = $product-&gt;getCategoryIds();\n                $categories = &#091;];\n                if (count($cats)) {\n                    foreach ($cats as $cat) {\n                        $category = $this-&gt;category-&gt;create()-&gt;load($cat);\n                        $categories&#091;] = $category-&gt;getName();\n                    }\n                }\n                $item&#091;$fieldName] = implode(&#039;,&#039;, $categories);\n            }\n        }\n        return $dataSource;\n    }\n}<\/pre>\n\n\n\n<p>Step 3 :- Webkul\/BlogManager\/Model\/Category\/Categorylist.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\BlogManager\\Model\\Category;\n\nclass CategoryList implements \\Magento\\Framework\\Option\\ArrayInterface\n{\n    public function __construct(\n    \\Magento\\Catalog\\Model\\ResourceModel\\Category\\CollectionFactory $collectionFactory\n    ) {\n        $this-&gt;_categoryCollectionFactory = $collectionFactory;\n    }\n    public function toOptionArray($addEmpty = true)\n    {\n        $collection = $this-&gt;_categoryCollectionFactory-&gt;create();\n        $collection-&gt;addAttributeToSelect(&quot;name&quot;);\n        $options = &#091;];\n        if ($addEmpty) {\n            $options&#091;] = &#091;&quot;label&quot; =&gt; __(&#039;-- Please Select a Category --&#039;), &quot;value&quot; =&gt; &#039;&#039;];\n        }\n        foreach ($collection as $category) {\n            $options&#091;] = &#091;&#039;label&#039; =&gt; $category-&gt;getName(), &#039;value&#039; =&gt; $category-&gt;getId()];\n        }\n        return $options;\n    }\n}<\/pre>\n\n\n\n<p>Step 4 :- Webkul\/BlogManager\/etc\/di.xml<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:ObjectManager\/etc\/config.xsd&quot;&gt;\n    &lt;preference for=&quot;Magento\\Catalog\\Ui\\DataProvider\\Product\\ProductDataProvider&quot; type=&quot;Webkul\\BlogManager\\Ui\\DataProvider\\Product\\ProductDataProvider&quot; \/&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p>Step 5 :- Webkul\/BlogManager\/Ui\/DataProvider\/Product\/ProductDataProvider.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\BlogManager\\Ui\\DataProvider\\Product;\n\nclass ProductDataProvider extends \\Magento\\Catalog\\Ui\\DataProvider\\Product\\ProductDataProvider\n{\n    public function addFilter(\\Magento\\Framework\\Api\\Filter $filter)\n    {\n        if ($filter-&gt;getField() == &#039;category_id&#039;) {\n            $this-&gt;getCollection()-&gt;addCategoriesFilter(&#091;&#039;in&#039; =&gt; $filter-&gt;getValue()]);\n        } else {\n            parent::addFilter($filter);\n        }\n    }\n}<\/pre>\n\n\n\n<p>Here you can find the similar extension  <a href=\"https:\/\/store.webkul.com\/magento2-marketplace-vendor-category.html\">Marketplace vendor categories <\/a> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"600\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-1200x600.png\" alt=\"Screenshot-from-2023-07-04-20-50-30\" class=\"wp-image-389632\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-1200x600.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-300x150.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-250x125.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-768x384.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30.png 1399w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Thanks and Happy coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As per the magento functionality, we can assign multiple categories to products. By default, you can not filter the products on the basis of categories. So today we will learn how to add a category column with a filter to the product grid. Here we will use the webkul sample module. https:\/\/webkul.com\/blog\/magento-development-01-module-registration\/ Step 1 :- <a href=\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":440,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2542,14477,2070],"class_list":["post-389624","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-admin-grid","tag-category-filter","tag-magento2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to add category column with filter to the Admin product grid in Magento 2 - Webkul Blog<\/title>\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\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add category column with filter to the Admin product grid in Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"As per the magento functionality, we can assign multiple categories to products. By default, you can not filter the products on the basis of categories. So today we will learn how to add a category column with a filter to the product grid. Here we will use the webkul sample module. https:\/\/webkul.com\/blog\/magento-development-01-module-registration\/ Step 1 :- [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/\" \/>\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-07-04T15:18:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-18T09:38:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-1200x600.png\" \/>\n<meta name=\"author\" content=\"Amir Khan\" \/>\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=\"Amir Khan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/\"},\"author\":{\"name\":\"Amir Khan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f2493d3639b5e8c05ae4e9af5f71063a\"},\"headline\":\"How to add category column with filter to the Admin product grid in Magento 2\",\"datePublished\":\"2023-07-04T15:18:04+00:00\",\"dateModified\":\"2023-07-18T09:38:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/\"},\"wordCount\":130,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-1200x600.png\",\"keywords\":[\"admin grid\",\"Category Filter\",\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/\",\"name\":\"How to add category column with filter to the Admin product grid in Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-1200x600.png\",\"datePublished\":\"2023-07-04T15:18:04+00:00\",\"dateModified\":\"2023-07-18T09:38:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30.png\",\"width\":1399,\"height\":700,\"caption\":\"Screenshot-from-2023-07-04-20-50-30\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add category column with filter to the Admin product grid 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\/f2493d3639b5e8c05ae4e9af5f71063a\",\"name\":\"Amir Khan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/da678755fca2993231591a761683dc95fcf81f335982ea5c1b38e9ccc1c6bc0c?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\/da678755fca2993231591a761683dc95fcf81f335982ea5c1b38e9ccc1c6bc0c?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Amir Khan\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/amir-khan754\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add category column with filter to the Admin product grid in Magento 2 - Webkul Blog","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\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"How to add category column with filter to the Admin product grid in Magento 2 - Webkul Blog","og_description":"As per the magento functionality, we can assign multiple categories to products. By default, you can not filter the products on the basis of categories. So today we will learn how to add a category column with a filter to the product grid. Here we will use the webkul sample module. https:\/\/webkul.com\/blog\/magento-development-01-module-registration\/ Step 1 :- [...]","og_url":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-07-04T15:18:04+00:00","article_modified_time":"2023-07-18T09:38:48+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-1200x600.png","type":"","width":"","height":""}],"author":"Amir Khan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Amir Khan","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/"},"author":{"name":"Amir Khan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f2493d3639b5e8c05ae4e9af5f71063a"},"headline":"How to add category column with filter to the Admin product grid in Magento 2","datePublished":"2023-07-04T15:18:04+00:00","dateModified":"2023-07-18T09:38:48+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/"},"wordCount":130,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-1200x600.png","keywords":["admin grid","Category Filter","Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/","url":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/","name":"How to add category column with filter to the Admin product grid in Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30-1200x600.png","datePublished":"2023-07-04T15:18:04+00:00","dateModified":"2023-07-18T09:38:48+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-04-20-50-30.png","width":1399,"height":700,"caption":"Screenshot-from-2023-07-04-20-50-30"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-add-category-column-with-filter-to-the-admin-product-grid-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add category column with filter to the Admin product grid 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\/f2493d3639b5e8c05ae4e9af5f71063a","name":"Amir Khan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/da678755fca2993231591a761683dc95fcf81f335982ea5c1b38e9ccc1c6bc0c?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\/da678755fca2993231591a761683dc95fcf81f335982ea5c1b38e9ccc1c6bc0c?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Amir Khan"},"url":"https:\/\/webkul.com\/blog\/author\/amir-khan754\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/389624","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\/440"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=389624"}],"version-history":[{"count":10,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/389624\/revisions"}],"predecessor-version":[{"id":391540,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/389624\/revisions\/391540"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=389624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=389624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=389624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}