The Countdown Timer shows, on the product page, how long a time-limited product pricing rule still applies: "SALE ENDS IN 00 DAYS 05 HOURS 12 MINUTES 40 SECONDS". It needs a rule that ends through a Date & Time condition. Turn it on in WooCommerce > Pricepep > Promotion > Countdown Timer.
How do I add a countdown timer?
- Create a product pricing rule with an end, for example the condition Date set to to with the last day of the sale. See the limited-time sale example or the happy hour example.
- Go to WooCommerce > Pricepep > Promotion.
- Under Countdown Timer, tick Enable and adjust the settings.
- Click Save Changes.
Which settings does it have?
| Setting | Default | What it does |
|---|---|---|
| Enable | Off | Turns the timer on. |
| Label | SALE ENDS IN | Text above the timer. |
| Position | Add to cart - Before | Add to cart - Before/After, Product meta - Before/After, Product summary - Before/After. |
| Time left less than | 1 day | Show the timer only when the end is this close: No limit, 5 to 45 minutes, 1 to 12 hours, 1 to 7 days or 14 days. |
Which rules get a timer?
A product shows the timer when a product pricing rule applies to it (at the chosen quantity, with the current cart) and that rule has an end in one of these conditions:
| Condition | Counts down to |
|---|---|
| Date, option to or specific date | The end of that day |
| Time, option to | That time |
| Date & time, option to | That moment |
| Days of week | The end of the last selected day in a row |
| Days of month | The start of the first day that isn't selected |
| Months | The first day of the first month that isn't selected |
Options set to from are ignored. If a rule has several such conditions, the earliest end counts. Cart discounts and checkout fees don't get a timer.
Does the timer slow down other pages?
No. The timer is set up only when at least one product pricing rule has a Date & Time condition, and since 2.6.0 its script and styles load only on pages that print a timer: product pages, and pages that call rp_wcdpd_display_countdown_timer(). The scripts load at the end of the page. Other pages, such as the shop, category and cart pages, load none of its files. (Before 2.6.0 they loaded on every page in that case.)
Does it work on variable products?
Yes, after the customer chooses a variation: the timer belongs to the variation's price.
Can I place the timer myself?
Developers can print it with rp_wcdpd_display_countdown_timer($product_id) for a simple product or a variation (see the function reference); a timer placed this way may not update when the quantity or variation changes. The template is extensions/promotion-countdown-timer/templates/countdown-timer.php; copy it to your-theme/wc-dynamic-pricing-and-discounts/extensions/promotion-countdown-timer/ to change it.
Can it show a start date?
No. The timer counts down to the end of an offer only. The time zone is your WordPress time zone (Settings > General). To show the dates of an offer, such as "Sale from 1 December to 7 December", use the {{start_date}} and {{end_date}} macros in Product Banners (since 2.6.0).
Frequently asked questions
Why doesn't the countdown timer show?
The product needs an applied product pricing rule with an end set by a Date, Time, Date & time, Days of week, Days of month or Months condition, and the time left must be below Time left less than (1 day by default).
Can the timer show when a sale starts?
No. It only counts down to when the offer ends. Since 2.6.0, Product Banners can show the first and last day of the offer with the {{start_date}} and {{end_date}} macros.
Does the countdown timer load scripts on every page?
No. Since 2.6.0 its script and styles load only on pages that print a timer, such as product pages, and the scripts load at the end of the page.