Magento 2 makes many things to support the developers in custom their webshop in an easy way. Popup is good to go strategy to attract visitors’ attention and engage them thoroughly to explore the website with more curiosity. So this article helps us learn the way to create a simple popup with a Modal widget in Magento.
With the modal widget, the developers can make a popup quickly. Now, we’ll learn how to create a popup in Magento by Modal widget.
Step 1: Create a template file.
* Fill content of popup in 'simple-modal_popup' element.
<div id="simple-modal_popup" style="display: none">
<div>I love Magento 2.</div>
<div id="open-modal_popup" style="margin: 10px">
<button class="action"><?= __('Click me to open popup!');?></button>