Hello Magento Friends,

In this blog, we will learn How to Add a Custom Button in the Backend Category Page Section in Magento 2.

Customization in Magento admin helps to ease the admin work. Sometimes you need a custom button on the backend category page to perform some action. A custom button on the category page will simplify admin work as the admin can perform actions easily.

Follow the below steps to add a custom button in the backend category page section in Magento 2.

Steps to Add Custom Button in Backend Category Page Section in Magento 2:

Step 1: First, we need to create a category form.xml file inside the extension at the following path.

app\code\Vendor\Extension\view\adminhtml\ui_component

Then add the code as follows

Note – You can change the fieldset reference as per your requirement to add a button in the category section. Here, we have taken the Search Engine Optimization fieldset section named “search_engine_optimization”.

Step 2: After that, we need to create a Categorybutton.php file inside the extension at the following path.

app\code\Vendor\Extension\Block\Adminhtml\Category\Edit

Then add the following code

Step 3: After that, we need to create a button.phtml file inside the extension at the following path.

app\code\Vendor\Extension\view\adminhtml\templates\category

And add the following code-snippet

Step 4: Once all files are created in your extension, you need to run Magento upgrade and deploy commands in your server.

Output:

You can see that the custom button is added to your category page in Magento 2 backend.

custom button on category page

Conclusion:

This way, you can add a custom button in the backend category page section in Magento 2. Alternatively, you can also Add Custom Button on Admin Sales Order View page in Magento 2.

Share the solution with your other Magento friends, and stay connected with us for more Magento 2 tutorials.

Happy Reading!

Click to rate this post!
[Total: 0 Average: 0]