Comment ajouter une barre d'annonce avec compte à rebours sur PrestaShop ?
Conversion and UX

How to add an announcement bar with a countdown on PrestaShop?

An announcement bar at the top of the page is the most direct way to communicate a limited offer. It is also one of the easiest elements to implement badly: wrong time zone, layout shift, or a countdown frozen by the cache.

What the bar must say

One message, one action, one deadline. Three elements and no more.

The message fits on one line on mobile, roughly forty characters. “Free shipping from €49” works, “Take advantage of our exceptional shipping offer” says nothing.

The action is a link to the page concerned. A bar that announces a promotion without leading to it forces the visitor to search.

The deadline, if there is one, as a countdown or a date. It only makes sense if it is real.

Important point: the countdown must match an actual end of offer. A countdown that restarts from zero on every visit is a misleading commercial practice, and a returning visitor spots it immediately.

The time zone problem

It is the most frequent technical error, and it produces gaps of one to two hours depending on the season.

Three clocks come into play: the server’s, the one configured in PrestaShop, and the visitor’s browser.

The rule that avoids problems: calculate the deadline server-side, transmit it in universal time, and let the browser do the conversion. The visitor then sees the countdown in their local time, which is the expected behaviour.

Two complementary checks. The switch to summer or winter time, if your offer straddles a change: a deadline calculated without accounting for the shift jumps by an hour. And the case of foreign visitors: an offer ending at midnight Paris time ends at 11 pm for a Portuguese customer, which is correct but must be accepted as such.

The countdown and the cache

Classic problem: the bar displays “3 hours left” to all visitors for two days, because the page is served from the cache.

The cause is simple: the countdown was calculated server-side at page generation time, then frozen with it.

The solution: the server transmits the end date, not the remaining duration. A browser-side script calculates the gap with the current time and updates the display every second. The end date can be cached without harm, the duration cannot.

Two complementary points. Plan the behaviour at expiry: the bar disappears, or displays an end message. A countdown at zero that stays displayed gives an impression of abandonment. And if your page is on a long cache, the bar itself can be loaded separately to stay up to date.

Announcement Bar & Countdown Timer — Promo Banner for PrestaShop 8 & 9The promo banner that builds urgency without weighing down your theme€59.00

The layout shift

A technical point that affects your performance metrics and is often discovered after the fact.

A bar inserted after page load pushes all the content down. The visitor who was about to click one element clicks another, and your visual stability metric degrades.

Three ways to avoid it.

Reserve the space from the initial render, with a fixed height, even if the content arrives later.

Display the bar as an overlay rather than in the flow, which shifts nothing but hides part of the content.

Serve the bar with the page, not lazy-loaded. It is the simplest solution when the bar’s content changes little.

Also watch the variable height: a message that wraps onto two lines on mobile and one on desktop produces a shift if the space was reserved on the wrong value.

Targeting

A bar displayed everywhere and to everyone loses its effectiveness in a few days. Four targeting axes.

By page. A free shipping announcement makes sense on product pages and the cart, less on content pages.

By language and country. An offer limited to France must not show to foreign visitors. It is a question of relevance and sometimes of compliance, if the conditions differ.

By customer group. An offer reserved for professionals does not concern individuals.

By behaviour. A bar shown only to new visitors, or only after a first visit, depending on what you communicate.

Language targeting is the most often neglected, and it produces the most visible result: a message in French on a German version of your store.

Closing

Three rules.

The bar must be closable. A banner that cannot be removed and that occupies a tenth of the screen on mobile is a nuisance.

The closing must be remembered, for a reasonable duration: the session, or a few days. Reopening the bar on every page is aggressive.

The memory must account for the message. If you change announcements, the new one must show even to those who had closed the previous one. That implies a version identifier in the memory.

This third point is the one you discover when noticing that a new campaign is seen by nobody.

Accessibility

Two points, quick to handle.

The contrast of the text on the bar’s background must respect the minimum ratio. Promotional bars readily use white on bright colours, which often falls below the threshold.

The close button must be reachable by keyboard and carry an explicit label for screen readers. A cross without alternative text is a mute button.

Add a point on the countdown: an update every second announced to assistive technologies produces an unbearable verbal flood. The element must not be declared as a continuously announcing region.

Measuring

Three indicators.

The click-through rate on the bar, relative to displays. Below 1%, your message or your targeting need reviewing.

The closing rate. A high rate signals a message perceived as intrusive or off-topic.

The revenue attributed to sessions having clicked on the bar, to compare with the others. It is the only figure that justifies keeping it.

A fourth point, to watch over time: the wear-out effect. A permanent bar becomes invisible in a few weeks. Alternating messages, or displaying the bar only during real operations, preserves its effectiveness.

The Announcement Bar and Countdown module for PrestaShop sets up this mechanism on PrestaShop 8 and 9: countdown calculated browser-side from an end date to stay accurate despite the cache, targeting by page, language, country and customer group, space reservation to avoid layout shift, and closing memory per message version.

Keep reading

Related articles