<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hiren Gediya</title>
    <description>The latest articles on DEV Community by Hiren Gediya (@hiren_gediya).</description>
    <link>https://dev.to/hiren_gediya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4127393%2F1db87658-92b0-44d8-b76a-d613fa7541a3.png</url>
      <title>DEV Community: Hiren Gediya</title>
      <link>https://dev.to/hiren_gediya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hiren_gediya"/>
    <language>en</language>
    <item>
      <title>How I Built a Flash Sale System for WooCommerce Without Changing Product Prices</title>
      <dc:creator>Hiren Gediya</dc:creator>
      <pubDate>Wed, 16 Sep 2026 06:42:43 +0000</pubDate>
      <link>https://dev.to/hiren_gediya/how-i-built-a-flash-sale-system-for-woocommerce-without-changing-product-prices-2gij</link>
      <guid>https://dev.to/hiren_gediya/how-i-built-a-flash-sale-system-for-woocommerce-without-changing-product-prices-2gij</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjfr55qhj25mup8tv6hhm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjfr55qhj25mup8tv6hhm.png" alt=" " width="799" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Running a flash sale in WooCommerce sounds simple.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Give customers 20% off selected products from 6 PM to midnight.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But once you start building this into a real WooCommerce store, things become more complicated.&lt;/p&gt;

&lt;p&gt;You need to think about scheduling, product selection, product variations, existing sale prices, cart calculations, campaign expiration, and what happens when multiple promotions are active at the same time.&lt;/p&gt;

&lt;p&gt;I ran into these problems while working on WooCommerce projects, and they eventually led me to build my own promotion system.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;The traditional WooCommerce approach is often to change a product's sale price or create a coupon.&lt;/p&gt;

&lt;p&gt;Both approaches can work, but they don't always fit the way a store owner wants to run a campaign.&lt;/p&gt;

&lt;p&gt;Imagine a store wants to run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;20% off selected products&lt;/li&gt;
&lt;li&gt;A flash sale for 4 hours&lt;/li&gt;
&lt;li&gt;A weekend promotion&lt;/li&gt;
&lt;li&gt;A Buy One Get One offer&lt;/li&gt;
&lt;li&gt;A discount for a specific product category&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The store owner shouldn't have to manually change product prices every time a campaign starts or ends.&lt;/p&gt;

&lt;p&gt;I wanted the promotion itself to control when and where the discount was applied.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the Campaign System
&lt;/h2&gt;

&lt;p&gt;I started designing promotions around a few basic pieces of information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Campaign type&lt;/li&gt;
&lt;li&gt;Start date and time&lt;/li&gt;
&lt;li&gt;End date and time&lt;/li&gt;
&lt;li&gt;Discount type&lt;/li&gt;
&lt;li&gt;Discount amount&lt;/li&gt;
&lt;li&gt;Products or categories&lt;/li&gt;
&lt;li&gt;Campaign status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made it possible to treat a promotion as a campaign rather than simply changing a product's price.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;h3&gt;
  
  
  Weekend Flash Sale
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Start:&lt;/strong&gt; Friday 6:00 PM&lt;br&gt;&lt;br&gt;
&lt;strong&gt;End:&lt;/strong&gt; Sunday 11:59 PM&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Products:&lt;/strong&gt; Selected products&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Discount:&lt;/strong&gt; 20%&lt;/p&gt;

&lt;p&gt;Once the campaign is active, the promotional rules can be applied without requiring the store owner to manually update every product.&lt;/p&gt;

&lt;h2&gt;
  
  
  The WooCommerce Side
&lt;/h2&gt;

&lt;p&gt;One of the interesting parts of building this system was figuring out where WooCommerce should apply the campaign logic.&lt;/p&gt;

&lt;p&gt;WooCommerce provides hooks and filters that can be used to work with product prices and cart calculations.&lt;/p&gt;

&lt;p&gt;The important part isn't simply applying a discount.&lt;/p&gt;

&lt;p&gt;The discount needs to behave correctly throughout the shopping experience:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product pages&lt;/li&gt;
&lt;li&gt;Shop pages&lt;/li&gt;
&lt;li&gt;Cart&lt;/li&gt;
&lt;li&gt;Checkout&lt;/li&gt;
&lt;li&gt;Order totals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You also need to consider variable products, existing sale prices, and different campaign conditions.&lt;/p&gt;

&lt;p&gt;A discount that looks correct on the product page but behaves differently in the cart isn't a successful implementation.&lt;/p&gt;

&lt;p&gt;Check Out the Project&lt;/p&gt;

&lt;p&gt;If you'd like to see the WooCommerce plugin I built from this experience:&lt;/p&gt;

&lt;p&gt;PromoForge – Smart Campaigns for WooCommerce&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hirengediya.com/projects/promoforge-smart-campaigns-for-woocommerce/" rel="noopener noreferrer"&gt;https://hirengediya.com/projects/promoforge-smart-campaigns-for-woocommerce/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PromoForge includes tools for Flash Sales, BOGO offers, scheduled discounts, and product/category-based promotions.&lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback or your experience with building and managing WooCommerce promotions.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>woocommerce</category>
      <category>php</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
