Commonly we have to demonstrate some kind of data in modal box when client goes to the site. Let’s see how we can overcome this issue. Below you can find the solution for this.

I assume you have the base knowledge about Magento 2 as we are working out as an extension.
As the first step you will have to register the extension, for that you need to create registration.php.
Proceed by creating module.xml in etc folder.
Now these two steps will create a New module in Magento 2.

Next create a block, here is the piece of code that need to put in our block

Next we need to think about how to put in .phtml file to see in frontend

And next you need to create default.xml within view/frontend/layout. Here is the code for it.

And finally the js for the modalbox, this should go within frontend/web/js/modal_overlay.js

Yes..!that’s it..Now create static block and activate it.

Cubet e-commerce team is seriously following the progress and learning the new features and developing concepts of Magento 2.  Please keep checking our Magento 2 Development page for updates.

Know More About This Topic from our Techies

Other Blogs:

Post By : Chinju Thomas (4 Posts)

"Chinju is the Project Lead in Cubet Techno Labs with 5.9 years of experience in Web Technologies. She strives to do her best in everything she attempts. She is skilled in PHP, Wordpress, Magento, Joomla, WHMCS, Mean.js, Angular.js, Mongodb, MySQL. Everything she knows came from self-study, going through tutorials and analyzing code ."

You might also like...

+91 484 4054324
Skype : cubettech
Leela Info Park,
Unit IX-C, 9th floor PhaseIV,
Kochi, Kerala, India

+44 2071938618
Skype : cubettech
Kemp House
160 City Road
London- EC1V2NX, UK.