English · Français
An editable welcome popup, shown once to each new visitor. Its content is a CMS block, per store view. Free, no third-party dependency.
- A welcome popup shown once, on the page where the visitor arrives, after a delay you set.
- Content you edit in the admin. It is a CMS block (Content > Blocks), one per store view with the same identifier: one text per shop, edited with the usual editor.
- Campaigns. The visitor's choice is kept per campaign. Change the campaign name and the popup shows again to everyone: do it for each new announcement.
- Cookie-banner friendly. A modal popup makes the rest of the page inactive, banner included. Give the CSS selector of your banner and the popup waits until it is gone.
- Safe by default. Never in the cart, the checkout, the order confirmation or the parcel tracking page, and never for search-engine crawlers. A functional cookie with no personal data.
- Easy to proofread. Add
?mxc-popup=previewto any page address to show the popup on every load, without cookie. - Light. The content sits in a
<template>: it is not rendered in the page and its images load only when the popup opens. No JavaScript library. - Accessible. Native
<dialog>(focus kept inside, Esc to close), labelled close button, reduced motion respected. - Translated into English and French.
composer require maxcode/module-popup
bin/magento module:enable Maxcode_Popup
bin/magento setup:upgrade
bin/magento cache:flushThe module has no database schema. Requirements: Magento Open Source or Adobe Commerce 2.4.x, PHP 8.2 or later.
- Content > Blocks: create one block per store view, all with the same identifier (default
maxcode_popup), each assigned to its own store view only. - Stores > Configuration > Maxcode > Popup, at the scope you want (default, website or store view):
| Setting | Role |
|---|---|
| Enable the popup | turns the popup on or off |
| CMS block identifier | the block shown, maxcode_popup by default |
| Campaign name | change it to show the popup again to everyone |
| Delay before opening (seconds) | 3 by default, 0 = as soon as the page is ready |
| Do not show again for (days) | 365 by default, 0 = until the browser is closed |
| Wait for this element to disappear (CSS selector) | optional, for a cookie banner |
| Maximum width (pixels) | 520 by default |
- Flush the
config,block_htmlandfull_pagecaches.
The block is plain HTML. Classes provided: mxc-popup__title, mxc-popup__text, mxc-popup__btn. Any element
with the data-mxc-popup-close attribute closes the popup (a "Discover" button, a link...).
<h2 class="mxc-popup__title">A new design</h2>
<p class="mxc-popup__text">The same products, the same service.</p>
<button type="button" class="mxc-popup__btn" data-mxc-popup-close>Discover the site</button>Your theme can redefine these properties on :root: --mxc-popup-bg, --mxc-popup-color, --mxc-popup-radius,
--mxc-popup-accent, --mxc-popup-accent-contrast, --mxc-popup-focus. The dark backdrop is set on
.mxc-popup::backdrop.
- Google penalizes windows that hide the content as soon as a visitor arrives from a search, especially on mobile. Keep the message short, wait a few seconds and make the close button obvious.
- The visitor's choice is kept in the
mxc_popup_<campaign>cookie (functional, no personal data: no consent required, but it may be listed in your cookie policy).
See CHANGELOG.md.
Free for any number of Magento installations that you own or operate. You receive the full source code and may adapt it to your needs; redistribution is not allowed. See LICENSE (free-module EULA).
Provided as is, without support or update commitment. For questions and paid services: ebusiness360.fr.