Features

  • Announcement bar rendered in page_top or page_bottom by the server: up to 5 messages that rotate, pause on hover, focus or with a button, and can be closed
  • Countdown per message to one fixed end for all visitors; the message hides at zero and the end date is shown without JavaScript
  • Up to 3 popups as native modal dialogs: image stored as a managed file, coupon code with a copy button, Esc and focus return
  • Opens after a delay, a scroll depth or on exit intent; every page view, once per visit or once every N days, remembered only in the browser
  • Up to 6 floating buttons with accessible names: tel:, a WhatsApp chat (wa.me with a first message per language), mailto:, links to Instagram, Facebook, TikTok, YouTube, X, LinkedIn, Pinterest or Telegram with our own generic icons, and back to top
  • Per item: dates, page types (front page, product, taxonomy term or product view, cart, checkout), device and colours with a WCAG contrast warning
  • One text per site language; cache tags and max-age up to the next scheduled change, with the anonymous page cache refreshed when an item starts or ends

A free-shipping threshold, a sale that ends on Sunday, a holiday closure, a welcome coupon: storefront messages change every week, and hard-coding them in a Twig template or a block for each campaign is slow. Promo Bar, Popups & Floating Buttons gives store admins one form for all of it, with dates, page types and texts in every language of the site, and output that never surprises the render cache.

How it fits into Drupal Commerce

Versions
Drupal 11.3 with Commerce 3.x on PHP 8.3. Tested with Olivero; any theme whose html.html.twig prints page_top and page_bottom works.
Admin
Commerce › Configuration › Store › Promo bar, popups and buttons, a configuration form with vertical tabs and fixed slots (5 messages, 3 popups, 6 buttons), behind its own permission so that marketing roles can edit it without site administration rights. Settings are one exportable configuration object with a schema.
Front end
The bar is printed through hook_page_top (or hook_page_bottom when it sits at the bottom), popups and buttons through hook_page_bottom; the library is attached only when something is printed.
Caching
The HTML is identical for every visitor and carries the configuration cache tag, route and language contexts and a max-age up to the next start or end. A small HTTP middleware also refreshes the internal page cache at that moment, which otherwise ignores render max-age.
Accessibility
Rotation can be paused (WCAG 2.2.2), popups are real <dialog> elements that close with Esc and give the focus back, buttons have names for screen readers, and the form warns about low contrast.

Installation

  1. Step 1

    Get the zip from My account › Downloads on ecom-addons.com and unzip it into modules/custom/.

  2. Step 2

    Enable Promo Bar, Popups & Floating Buttons in Extend (or drush en ecom_addons_promo_bar).

  3. Step 3

    Grant Administer the promo bar, popups and floating buttons to the roles that run campaigns, then switch on the sample message in Commerce › Configuration › Store.

Download the step-by-step guide (PDF)

FAQ

Does it work with the page cache and Dynamic Page Cache?

Yes. Nothing in the HTML depends on the visitor: devices, popup frequency and the "closed" flag are handled in the browser, and pages are refreshed when you save or when a scheduled item starts or ends.

Can each language have its own text?

Yes, one field per installed language; a missing translation falls back to the default language.

Does it add cookies or call external services?

No. The browser only remembers locally that a visitor closed the bar or saw a popup. The coupon code is shown and copied; the promotion itself is created in Commerce.

Can I keep it off the cart and checkout?

They are excluded by default for every item; tick them only if you want a message there.

Does the WhatsApp button take orders?

No. It opens a WhatsApp chat with your number and an optional first message in the visitor's language; ordering through WhatsApp is a separate addon.

Version history

  1. Loading…

Reviews

Loading…