For OpenCart 2.3, 3.0, 4.0 and 4.1
The announcement bar
- Your text (up to 200 characters), an optional button with an address (http://, https:// or a path starting with /), the background and text colours.
- A schedule: "show from" and "show until", as a date or a date and time, by the shop's clock. Empty = no limit.
- Visitors can close it (switch this off if you like); a closed bar stays closed until you change its text or address.
- Not shown on the checkout, payment and account pages.
The newsletter popup
- Off until you switch it on. A title, a text, a delay in seconds (0 to 300), and "ask again after N days" (0 = never again once closed). Someone who signed up is never asked again. It has its own schedule.
- Closes with the cross, a click outside, or Escape; the e-mail box gets the focus when it opens.
- A hidden trap field: a robot that fills it gets a fake "thank you" and nothing is created.
- At most 5 sign-ups an hour from one visitor (the visitor is stored as a hash, never as an IP address) and 500 a day in all. The same address (in any letter case) cannot get a second code.
The discount code
WHAT YOU SEE (Extensions > Modules > Supreme Announcement Bar and Newsletter Popup)
- A new coupon for each person in your normal OpenCart coupons: a percent or a fixed amount, a smallest cart, valid from yesterday for N days (1 to 365), one use in total and one per customer, for everyone (no login needed). The code looks like WELCOME-K7P2QX; the start (up to 8 letters) is yours.
- The code is shown in the popup and e-mailed with your own subject and message ({code} {value} {days} {shop}). If the e-mail cannot be sent the code is still shown. Switch the e-mail off to show it only.
- The code was tested in the real cart.
- All settings on one page, checked when you save: bad dates, an end before the start, a button address that is not http/https/path, a percent above 100 are refused with a message; numbers are corrected to their limits.
- The list of sign-ups: address, code, whether the code was used, whether the mail went out, date; the total and the last 7 days; a CSV download (cells that start with = + - @ are made safe for spreadsheets).
Safe by design
- All texts are cleaned when saved and escaped on every page. Admin pages need Access, saving needs Modify; the list and the CSV need a logged-in admin. The join end point answers POST only.
Notes
- The sign-ups table is your data and is kept when you uninstall. The coupons stay in your coupon list.
- It does not subscribe the address to a mailing list tool; export the CSV for that.
- The admin screens are in English only; the storefront words (button, placeholder, messages) are translatable. The bar and popup texts are what you type, so type them in the language of the shop.
- Tested on OpenCart 4.1.0.4, 4.0.2.3, 3.0.5.1 and 2.3.0.2 with the real admin installer (install, settings, the bar and its schedule, sign-ups, coupons, the mail into a test mail server, the code in the cart, list and CSV, uninstall, reinstall). The popup's own JavaScript (delay, closing, the remembered answer) and the admin sign-up list were syntax-checked but not clicked in a browser.