Magento2: How to add new grid in Category Listing Page

Here is a tutorial on how to add new Grid in Category Listing Page. For this example we will assume we want to add a grid same as Product Category Positions for Category Brands. It should look something like below:


Assume that you have a custom module called Namespace_Module. You will create following files in your module:

Namespace_Module\view\adminhtml\ui_component\category_form.xml


Namespace_Module\Block\Adminhtml\Category\MyCustomGrid.php


Namespace_Module\view\adminhtml\templates\catalog\category\edit\assign.phtml


Namespace_Module\view\adminhtml\web\catalog\category\edit\assign.js


Namespace_Module\Controller\Adminhtml\Category\Assign.php


Namespace_Module\Block\Adminhtml\Category\Tab\MyCustomGrid.php



For saving, updating and deleting the positions you need to create plugin on category save which takes the posted json, compares with original json and performs the required operation.

Comments

Popular posts from this blog

Magento 2: How to create new indexer for your custom module

Xdebug - PHPStorm - Ubuntu: How to configure Xdebug on Ubuntu for PHPStorm

Magento 2 - Vue Storefront PWA Integration: How to create a new VSBridge indexer job and Elastic Index for your custom module