Hello Magento Friends,

In today’s blog, I will explain How to Open Popup on the Button Click in Magento 2 Admin.

Magento 2, the popular e-commerce platform, provides extensive customization capabilities for both the front end and back end. One such requirement might be the need to open a popup window in the admin panel upon clicking a button, enabling the display of additional information or performing specific actions without navigating to a different page. In this article, we’ll explore how to achieve this functionality in the Magento 2 admin panel.

Steps to Open Popup on Button Click in Magento 2 Admin:

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

app\code\Vendor\Extension\etc\adminhtml\system.xml

Then add the code as follows

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

app\code\Vendor\Extension\Block\Adminhtml\System\Config\Custompopup.php

And add the code as given below

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

app\code\Vendor\Extension\view\adminhtml\system\config\downloadlinkbutton.phtml

Then add the below-mentioned code

Conclusion:

Integrating a popup window in the Magento 2 admin panel can significantly enhance user interaction and streamline administrative tasks. By following the steps outlined in this article, you can effectively open a popup window on a button click, allowing you to display relevant information or perform specific actions without navigating to a different page. Leveraging this functionality can contribute to a more efficient and user-friendly Magento 2 admin panel experience.

If you find it difficult to perform these steps, Magento 2 experienced developers can help you with that.

Happy Coding!

Click to rate this post!
[Total: 1 Average: 5]