How to Add a Flash Sale Timer on WooCommerce Store

Updated On:

,By

How to Add a Flash Sale Timer to WooCommerce Without Changing Prices?

Want to create limited-time offers in your WooCommerce store without actually changing product prices in the database? In this tutorial, we’ll show you how to set up dynamic flash sale pricing with a countdown timer—using a custom plugin that temporarily modifies product prices at runtime. No manual price updates needed!


What We’re Building

  • A custom WooCommerce plugin that:
  • Adds a price drop metabox to the product editor.
  • Lets you enable a timed discount (e.g., 20% off for 60 minutes).
  • Dynamically applies the discount without saving the new price to the database.
  • Displays a live countdown timer on the product page.
  • Automatically disables the price drop when the timer expires.

Why Use Dynamic Pricing?

  • No need to edit actual prices.
  • Perfect for flash sales or countdown offers.
  • Doesn’t interfere with existing sale prices or scheduling.

Step 1: The Plugin Code

Create a new plugin file in your WordPress installation:

Paste the following code:


Step 2: Dynamically Discount the Price

This next section ensures the discounted price is applied in the frontend only—and only during the active time window:


Step 3: Add Countdown Timer to Product Page

Add a visual countdown to build urgency:


Step 4: Auto Cleanup After Expiry

Automatically disable the price drop after the timer runs out:


Final Result

  • ✅ Price drops only when enabled and during the specified time.
  • ✅ No price stored in the database is modified.
  • ✅ Visual timer creates urgency for customers.

Want More?

This is just the beginning. You could extend this plugin with:

  • Product archive badge (e.g., “Flash Deal!”)
  • Support for variable products
  • Discount per user role or cart condition
  • Admin dashboard countdown views

Wrap-up

With this simple plugin, you now have the power to run real-time flash sales in WooCommerce—without ever touching the actual product prices. It’s fast, non-intrusive, and great for conversions. You can download from here.

Need help turning this into a professional plugin? Let me know—I’d be happy to assist!

Crazy about CRO?

Dessert Calories Don’t Count

Our Sales Funnel Strategy does.

We don’t spam! Read more in our privacy policy

Leave a Reply

Your email address will not be published. Required fields are marked *