How To

Magento 2: How to add New Button to The Product List Page in Backend using UI Component

Hello Magento Fellas?,

How are you all doing? I am here with one more article to solve the problem of Magento 2:How to add New button to the product list page in Backend using UI Component. Do visit the most recent article published to solve the problem for Apply Coupon Code While Programmatically Adding Product to Cart In Magento 2. Let’s Begin?.

Introduction

Mainly, Magento 2 has a new innovative design namely UI component which is used to render the UI elements on the screen. By this it becomes an easy interaction for the visual element of UI and the further process of the user’s data. Mainly UI components help the managers to make use of the grids and many other beneficial impacts. This article will help you to add a new button in the Backend side of the product list page.

Steps to Code:

Create file as given below path :

app\code\Vendor\Extension\view\adminhtml\ui_component\product_listing.xml

<?xml version="1.0" encoding="UTF-8"?>

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

    <argument name="data" xsi:type="array">

        <item name="buttons" xsi:type="array">

            <item name="primary" xsi:type="array">

                <item name="label" xsi:type="string" translate="true">New Button</item>

                <item name="class" xsi:type="string">primary</item>

                <item name="url" xsi:type="string">router/controller/action</item>

            </item>

        </item>

    </argument>

</listing>

After you apply the above step you will be easily adding the new button on the backend side of the product list page.

Final Words:

I hope this illustration given above was helpful to you. Make sure you connect with our Support Team if any difficulties you face during the implementation. Do share with your Magento friends and comment on your reviews in the comment section below. If there are any difficulties in any other topic then comment down and we will try to help you by creating informative articles.

Happy Coding.

Click to rate this post!
[Total: 7 Average: 3.7]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate 🎖️ Certified Magento Developer👨‍💻. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.🏏

View Comments

    • The main code is already shared above, Rest you just need to create the required module files for the custom extension.

  • It does not work in case Add Secret Key to URLs option enabled in settings
    It create button and follow the link specified in url element but immediately redirect to dashboard because secret key is incorrect
    Example

    Go To CMS Pages
    primary
    admin/cms_page/index

Recent Posts

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

2 mins ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

2 days ago

How Upcoming Cookie Changes Will Affect Your E-commerce Website?

The e-commerce world is constantly in flux. New tech and strategies emerge daily to help…

2 days ago

Magento 2: How to Add Header and Footer in Checkout

Hello Magento Friends, In today’s blog, we will discuss adding a header and footer to…

3 days ago

Understanding Flexbox Layout in React Native

Hello React Native Friends, Building a visually appealing and responsive mobile app is crucial in…

5 days ago

HYVÄ Themes Releases: 1.3.6 & 1.3.7 – What’s New

We have brought exciting news for Magento store owners. Hyvä Themes recently released 1.3.6 and…

5 days ago