Hyvä makes it easy to create custom modal dialogs. Start by building your Hyvä modal like this:

You can open the dialog with any HTML element. The following example uses a span element rendered as a Hyvä question mark icon:

You also need to include the following code, for example in the file catalog_product_view_type_configurable.xml in your Hyvä child theme:

You can also choose another XML file. The file catalog_product_view_type_configurable.xml ensures that the modal works on all configurable product pages, for example. If you use catalog_list_item.xmlinstead, you can make it available on category pages.

After running the following command, you should be able to open the modal. Close it with Escape, by clicking outside the dialog, or with the X button at the top.

Creating a modal dialog with a close button in Hyvä
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.
Tags: