User guide
Promo Flash Sale for Magento 2: User Guide
Countdown timers, listing badges, a campaign bar and a widget that follow the real dates of your promotions, never a fake deadline.
- Version 1.2.0
- Magento 2.4.7 to 2.4.9
- PHP 8.2 to 8.5
- Hyvä and Luma
Flash Sale Countdown shows countdown timers for your sales on product pages, category pages, CMS pages and in a bar at the top of the store. Each flash sale is linked to a real promotion (a catalog price rule, a cart price rule, special prices or a scheduled campaign) and its timer follows that promotion's real dates. The timer only appears while the discount really applies and disappears when the promotion ends or is switched off, so shoppers never see a deadline that is not true.
- Demo, category badges (Luma): https://demo.commercegears.com/gear/bags.html?tour=promo-flash-sale
- Demo, category badges (Hyvä): https://demo.commercegears.com/hyva/gear/bags.html?tour=promo-flash-sale
- Demo, flash sale widget (Luma): https://demo.commercegears.com/flash-sale
- Demo, flash sale widget (Hyvä): https://demo.commercegears.com/hyva/flash-sale
- Admin demo: https://demo.commercegears.com/try-admin/promo-flash-sale
Requirements
| Magento | Magento Open Source and Adobe Commerce 2.4.7 to 2.4.9 |
| PHP | 8.2 to 8.5 |
| Themes | Luma and Hyvä (checkout is not changed) |
| Required packages | commercegears/module-core (1.3 or later), commercegears/module-promo-core (1.1 or later, free, installed automatically) |
| Optional | commercegears/module-promo-scheduler (follow its campaigns), Multi-Source Inventory (salable quantity) |
| Cron | Magento cron must run (the module checks its sales every minute) |
Installation
Install with Composer from repo.commercegears.com (see https://commercegears.com/composer-access/):
composer require commercegears/module-promo-flash-sale
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento cache:flushConfiguration
Stores > Configuration > CommerceGears > Flash Sale Countdown.
General
- Enabled: turns the module on or off for a scope. When off, no timers, badges, bars or widgets are shown there. At the default scope it also stops the cron, so linked rules are no longer switched and stay as they are.
- Correct the Shopper's Clock: the browser asks the server for the time once per session, so timers are right even when the shopper's computer clock is wrong.
- Switch Rules While Promo Scheduler Is On: see "Working with Promo Scheduler" below.
- Timer Colour: hex colour of timers and badges, for example #b42318. Empty uses the default red.
Product Pages and Listings
- Listing Badges in the Last Hours Only: show the "Ends in" badge on category pages only when the sale ends within this many hours. 0 shows it during the whole sale.
- Product Page Timer Style: Boxed (days, hours, minutes and seconds in boxes) or Compact (one line).
Stock Indicator
- Show "Only N Left" at or Below: the salable quantity at which "Only 4 left" appears (default 10).
- Show "% Sold" From: the "73% sold" bar appears once at least this share is sold (default 20).
Creating a flash sale
Go to CommerceGears > Promotions > Flash Sales and click Add Flash Sale.
Flash Sale
- Enabled, Name (for the admin) and Storefront Title (shown to shoppers, for example "Black Friday").
- Store Views and Customer Groups. Empty customer groups means the groups of the linked rule. The sale is never shown on a website or to a group the linked rule does not cover.
- Priority: when two sales cover the same product, or both have a bar, the lower number wins.
Linked Promotion
- Linked To:
- Catalog price rule: timers and badges appear on the rule's products.
- Cart price rule: the rule's conditions are not evaluated, so enter SKUs or categories under Products for product timers and badges. The bar and the widget work without them.
- Special prices of products: enter SKUs or categories. Every product with a special price below its price gets a timer that ends with its own Special Price To date.
- Scheduled campaign: a running or upcoming campaign of Promo Scheduler that has a Storefront Label.
- Timing (catalog and cart price rules):
- Use the linked promotion's dates: the timer runs from the rule's From date to the end of its To date (whole days, in each store view's time zone), and only while the rule is active. A rule without a To date has no countdown: product timers and badges are hidden and the bar and widget show the title only.
- This sale's dates: switch the rule on and off: enter a start and an end (date and HH:MM, store time zone). The module switches the rule on at the start and off at the end, to the minute, by cron. Create the rule inactive and leave its From and To dates empty (they still limit the timer). If you switch the rule off by hand during the sale, it stays off and the timer disappears.
- "Starts In" Teaser (Hours): show "Starts in 05:12:09" this many hours before a confirmed start. A start is confirmed for sales with their own dates, for active rules with a future From date, for future special prices and for upcoming scheduled campaigns.
Products: Categories (with subcategories) and SKUs (one per line). For catalog price rules they are optional and limit the timers to these products.
Storefront: Product Page Timer, Listing Badge, Campaign Bar with Bar Text, Bar Link (a URL or a path such as /gear/bags.html), Link Text, Bar Background Colour, Bar Text Colour and Close Button (a closed bar stays closed for this sale in the shopper's browser). Show the Bar On chooses the pages: All pages (default), The sale's products and categories (the category pages of the sale's categories and their subcategories, and the product pages of the sale's products; a sale without categories shows it on the category pages that list its products), Selected CMS pages (choose them under CMS Pages; pick the home page's CMS page to include the home page) or Home page only.
Stock Indicator (under the product page timer while the sale is live):
- "Only 4 left" when stock is low.
- "% sold" from the stock at the start: the salable quantity is noted when the sale starts; "% sold" compares it with the current salable quantity.
- "% sold" from this sale's orders and a sale quantity: units of the product ordered during the sale divided by Sale Quantity per Product. Cancelled orders are taken off again.
Save the sale. The status panel at the top shows whether the sale is live, its computed start and end, the number of products with timers, orders during the sale and notes that explain why a sale is not shown (for example "The linked promotion does not give its discount now").
Statuses
| Status | Meaning |
|---|---|
| Live | The promotion gives its discount now; timers are shown. |
| Starts soon (teaser) | A confirmed start within the teaser hours; "Starts in" is shown. |
| Scheduled | A confirmed start later than the teaser hours. |
| Not live | The promotion does not give its discount now (switched off, outside its dates, start not confirmed). |
| Ended | The end has passed. |
| Disabled | The sale is switched off. |
| Promotion not found | The rule was deleted, or the campaign is not running or upcoming or has no Storefront Label. |
CMS widget
Content > Pages (or Blocks or Widgets) > Insert Widget > Flash Sale Countdown: choose the sale, the style (Large, Boxed, Compact), a title, text, button text and link, and whether to show "Starts in" before the start. The widget shows nothing while the sale is not live.
Working with Promo Scheduler
When Promo Scheduler is installed and switched on, it is in charge of switching price rules. Flash sales with their own dates then do not switch their rule; they follow the rule's real state instead. Link the flash sale to the scheduled campaign to show a timer for the campaign's minute-precise window, and enter SKUs or categories for product timers. If your flash sale rules are in no scheduled campaign, you can allow flash sales to switch them with Switch Rules While Promo Scheduler Is On. When the scheduler is switched off, sales linked to its campaigns are not shown. If a sale switched its rule on before the scheduler was switched on, nothing switches that rule off at the sale's end: the sale's status panel says so, so you can switch the rule off yourself.
Reports
The Flash Sales grid shows orders during each sale that contain sale products (for cart rules: orders that used the rule), units and revenue of those items in the base currency. CommerceGears > Promotions > Overview shows impressions (timer or bar seen), clicks (bar link, widget button), bar closes and orders per sale under the source "Flash Sale".
Other promotion modules
Running and upcoming flash sales are shared with CommerceGears PromoCore, so modules such as Cart Progress Bar can show "Sale ends in 02:14:33" for them.
Page cache and performance
Timers carry the absolute end time and count down in the browser, so cached pages stay correct. When a sale starts or ends, the cron cleans the page cache of its products, its categories and pages with its widget, and of every page when the sale has a bar (built-in cache or Varnish). Storefront pages read one cached list of sales; rules are never evaluated on a storefront request. The stock indicator is loaded after the page and cached for 30 seconds.
CLI
bin/magento commercegears:promo:flash-sale:run [--id=<sale id>]... [--products]
bin/magento commercegears:promo:flash-sale:status [--json]run does what the cron does every minute (with --products it also rebuilds the product lists). status lists sales with their status, linked promotion, start and end and the notes.
Permissions
Under CommerceGears > Promotions in the role resources: Flash Sales > View Flash Sales, Create, Edit and Delete Flash Sales and Flash Sale Settings.
Troubleshooting
- No timer appears: open the sale and read the notes in the status panel. Check that cron runs, that the linked rule is active and its dates include today, and for cart rules and campaigns that SKUs or categories are entered.
- The timer appears late or stays after the end: cron did not run on time. The browser hides an ended timer at once; the page cache is cleaned at the next cron run.
- No stock indicator: it only shows during a live sale, for products whose stock is managed, and only when the numbers reach the thresholds.
Uninstall
Disable or delete running sales with their own dates first (their rules are switched off), then run composer remove commercegears/module-promo-flash-sale and bin/magento setup:upgrade. Linked rules are never deleted.
This guide is for version 1.2.0 and also comes with the module, in docs/user-guide.md. All user guides