Opencart extensions free download · 5 min read · Updated

Newsletter Popup for OpenCart 4: Exit Intent, Consent, Double Opt-in and a Welcome Coupon (Free Extension)

Collect guest email addresses in OpenCart 4 with a newsletter popup: delay or exit intent, consent checkbox, double opt-in, a coupon after confirmation and a CSV export for your email platform.

Opencart 4 newsletter popup

Most visitors leave without buying, and you never hear from them again. An email address is the cheapest way to bring them back, but OpenCart 4 only lets registered customers subscribe (Account > Newsletter). A guest who would happily trade an address for 10% off has nowhere to type it. A newsletter popup gives them that place.

This free extension adds a newsletter popup to OpenCart 4. It opens after a delay or when the mouse heads for the browser’s close button, asks for an email address and consent, can send a double opt-in email, and shows a coupon code once the address is confirmed. Subscribers are stored in your database and export to CSV for Mailchimp, Klaviyo or Brevo. On phones it opens as a bottom sheet instead of covering the page. Tested on OpenCart 4.1.0.4.

Download: newsletterpopup.ocmod.zip (OpenCart 4.0.2.x to 4.1.x, free, no core file changes)

OpenCart 4 category page dimmed behind a newsletter popup titled Get 10% off your first order with an email field, a consent checkbox and a Sign me up button
The popup on a computer, 8 seconds after the page loaded.

What the newsletter popup does

  • Opens after a delay you set (8 seconds by default) or on exit intent, when the mouse leaves the top of the window on a computer.
  • Has a consent checkbox, required by default, and stores the exact consent text with each sign-up.
  • Optional double opt-in: sends a confirmation email and only counts the address once the link is clicked.
  • Shows a coupon code from Marketing > Coupons after sign-up (or after confirmation with double opt-in).
  • Stays hidden for a number of days after someone closes it or signs up (14 by default).
  • Never shows on checkout, cart or account pages, and by default not to logged-in customers.
  • Sets the core newsletter flag when the address belongs to a customer account, so Account > Newsletter shows Yes.
  • Lists subscribers in the admin with their status and exports them to CSV.
  • A hidden honeypot field and a limit of 5 sign-ups per IP address per hour keep bots out.
  • Keyboard friendly: focus moves to the email field, Tab stays inside the dialog, Esc closes it.

Install the extension

  1. Create the welcome coupon first in Marketing > Coupons (for example 10%, Uses Per Customer 1), if you want to offer one.
  2. Download newsletterpopup.ocmod.zip.
  3. Go to Extensions > Installer, click Upload and choose the zip.
  4. Go to Extensions > Extensions, choose Modules, find Newsletter Popup and click Install.
  5. Click Edit, switch Status on, enter the coupon code and click Save. The settings page refuses a code that isn’t an enabled coupon.
Newsletter Popup settings in OpenCart 4 admin with heading, text, button, consent text, coupon code WELCOME10, thank-you text, double opt-in, delay 8 seconds, exit intent, 14 days and guests only, plus a subscriber list with confirmed and waiting badges and an Export CSV button
Settings and the subscriber list. The CSV export includes the consent text and the confirmation time.

Double opt-in, step by step

  1. The shopper enters an email address, ticks consent and clicks Sign me up.
  2. The popup says “Almost done! Check your inbox and click the link to confirm your email address.”
  3. The email has a Confirm my subscription button with a one-time link.
  4. The link opens a “Subscription confirmed” page in your store with the coupon code. The page is sent with X-Robots-Tag: noindex, nofollow.
  5. Clicking the link again shows “This confirmation link is invalid or was already used.”
Confirmation email: Thanks for signing up for the Your Store newsletter. Please confirm your email address, with a blue Confirm my subscription button and the link below it
The double opt-in email.
Subscription confirmed page in the OpenCart 4 store with the thank-you text and the coupon code WELCOME10
The confirmation page shows the coupon once the address is confirmed.

Double opt-in costs you some sign-ups, but it proves the address is real and that its owner asked for your emails. In much of the EU that proof is what you need if a subscriber says they never signed up, and it keeps typo addresses off your list, which helps deliverability.

Protection against bots and list leaks

The form has a field hidden from people. Bots fill every field, so a filled honeypot gets a fake “thank you” and nothing is saved. After that come the email and consent checks and a per-IP limit:

// Honeypot: a field people never see. Bots fill it; pretend it worked.
if (!$json && !empty($this->request->post['website'])) {
    $json['success'] = $this->setting('success');

    $this->respond($json);

    return;
}

if (!$json && (oc_strlen($email) > 96 || !filter_var($email, FILTER_VALIDATE_EMAIL))) {
    $json['error']['email'] = $this->language->get('error_email');
}

if (!$json && $this->setting('consent') !== '' && empty($this->request->post['consent'])) {
    $json['error']['consent'] = $this->language->get('error_consent');
}

if (!$json) {
    $recent = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "newsletterpopup` WHERE `ip` = '" . $this->db->escape($ip) . "' AND `date_added` > DATE_SUB(NOW(), INTERVAL 1 HOUR)")->row;

    if ((int)$recent['total'] >= 5) {
        $json['error']['email'] = $this->language->get('error_limit');
    }
}

An address that’s already on the list gets the same answer as a new one, so nobody can use the form to check whether someone subscribes to your store.

Popups that don’t hurt the page

Google’s page experience guidance warns against interstitials that make content hard to reach, especially on phones. The extension’s defaults follow that advice: nothing appears for the first 8 seconds, the phone version is a bottom sheet that leaves the page visible above it, there’s always a close button, and once closed it stays away for 14 days.

OpenCart 4 store on a phone with the newsletter form as a bottom sheet covering the lower third of the screen
On phones the form slides up from the bottom.

What we found when testing

  • A fatal error we had to fix. The confirmation page first called $this->document->setRobots(), which doesn’t exist in OpenCart 4.1. The address was confirmed and then the shopper saw an error page. We now send an X-Robots-Tag header instead.
  • Without the consent box ticked, the form showed “Please tick the box to agree to receive emails.” under the checkbox.
  • After signing up, the next visit showed no popup (the np_hide cookie was set for 14 days). The cart page never showed it.
  • Signing up as Jane.Doe@Example.com stored the address in lower case, linked it to Jane’s customer account and set her newsletter flag after confirmation.
  • The sixth sign-up from one IP within an hour got “Too many sign-ups from your connection. Please try again later.” A request with the honeypot filled got a thank-you and saved nothing.

Sending the emails

OpenCart has no newsletter sender for guests, so use your email platform. Export the CSV (email, confirmed, signed_up, confirmed_at, consent_text, ip), import the confirmed rows, and send from there. Our free Mailchimp templates and Klaviyo templates are a good start, and SPF, DKIM and DMARC keep those emails out of spam. The extension also uses your store’s mail settings for the confirmation email, so set those up first (System > Settings > Mail).

Rupak Nepali
Written byRupak Nepali

Rupak Nepali is a web developer, manage Webocreation website and the author of six books:
Getting Started with OpenCart Module Development (Packt, 2013),
OpenCart Theme and Module Development (Packt, 2015),
OpenCart 4: Dev Guide for Themes & Extensions (2024),
OpenCart 4: User Manual (2025),
Cloudflare for the Enterprise Website (2026) and
The Technical Web Guide for Marketers (2026).
Rupak has built OpenCart stores and extensions since 2010, has published more than 600 tutorials on Webocreation, and shares free OpenCart extensions on GitHub.
Find Rupak on
GitHub | Amazon | LinkedIn | X | YouTube.

Leave a Reply

Your email address will not be published. Required fields are marked *