Woo Advanced Sales Campaigns releases
Create advanced, schedulable sales campaigns with countdown timers, targeting, and store notices.
by Michael Patrick · github.com/michaelspatrick/woo-advanced-sales-campaigns
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/michaelspatrick/woo-advanced-sales-campaigns/archive/refs/heads/main.zipA lightweight, developer-friendly WooCommerce extension for running advanced sales campaigns from a single place.
This plugin was originally built for Dragon Society International to manage complex, date-driven promotions (Black Friday / Cyber Monday, martial-arts–specific dates, etc.) with clear admin control and elegant front‑end display.
Features
- Campaign post type (
Sales Campaignsunder WooCommerce)- Create multiple named campaigns (e.g., Black Friday 2025, Rick Moneymaker Birthday Sale).
- Each campaign is independent and can have its own dates, discounts, targeting and messaging.
Date Strategy & Status
- Two date strategies (per campaign):
- Fixed-date range – simple start + end date window.
- Holiday-based window – choose from built‑in or custom holidays, plus:
- Offset in days (run before or after the holiday).
- Duration in days.
- Mode-aware status
- The campaign’s status is calculated only from the selected strategy:
- If Date Strategy = Fixed-date range, only the fixed dates are used.
- If Date Strategy = Holiday-based window, only the holiday window is used.
- No mixing / fallback between strategies.
- The campaign’s status is calculated only from the selected strategy:
- Status override
Automatic (based on date strategy)Force Running (ignore schedule)Force Ended (ignore schedule)
Holidays
- Built-in holiday helper for a given year, including:
- Seasonal markers (First Day of Spring/Summer/Autumn/Winter).
- Chinese New Year (modern range is table-based for accuracy).
- Common Western holidays (New Year’s, Valentine’s, Easter, Independence Day, Halloween, Thanksgiving, Black Friday, Cyber Monday, Christmas, etc.).
- Custom holidays UI
- WooCommerce → Sales Holidays.
- Add arbitrary named dates (Month/Day) via a small table UI.
- These custom holidays appear in the campaign Holiday dropdown for all years.
Discount & Shipping
- Discount types
- Percentage (%) off.
- Fixed amount off.
- Respects existing sales
- Option to apply or skip products already on sale.
- Global free-shipping flag
- Per-campaign toggle: “Enable free shipping while this campaign is active (for matching products).”
- Exposed as meta / runtime state so you can hook it into your shipping rules as needed.
Internally, discounts are calculated against the regular price and applied as the best campaign price when multiple campaigns are active and targeting the same product.
Targeting
Per campaign you can mix and match:
- Include / Exclude products
- AJAX Select2 product search (typeahead).
- Include / Exclude categories
- AJAX Select2 term search for
product_cat.
- AJAX Select2 term search for
- Include / Exclude tags
- AJAX Select2 term search for
product_tag.
- AJAX Select2 term search for
Targeting rules are AND‑combined in a sensible way:
- If include lists are non‑empty, the product must match at least one include entry.
- If the product matches any exclude entry, it is excluded from the campaign.
Front-end: Pricing & Savings
- Hooks into WooCommerce price filters:
woocommerce_product_get_pricewoocommerce_product_get_sale_pricewoocommerce_product_is_on_salewoocommerce_get_price_html
- For matching products in active campaigns:
- Calculates a discounted price from the regular price.
- Applies the lowest discount if multiple campaigns apply.
- Renders regular price struck out with sale price plus:
- A savings line:
You save $X (Y%)on the next line in a smaller, styled font.
- A savings line:
Front-end: Countdown Timer
On product pages for items targeted by a running campaign with countdown enabled:
- Renders a circular countdown display with:
- Days, hours, minutes, seconds.
- Uses the calculated campaign end timestamp as the target.
- Includes a small note below the timer:
- “This is how much longer this special price is available.”
The timer is rendered via woocommerce_single_product_summary and updated every second with JavaScript.
Per-Campaign Store Notice
Each campaign can optionally control the WooCommerce store notice bar:
- Checkbox: “Show a custom WooCommerce store notice while this campaign is active.”
- Textarea for the custom message.
- At runtime:
- If at least one campaign is active and has store notices enabled:
- The plugin forces
woocommerce_demo_storeon via filter. - Replaces the
woocommerce_demo_store_noticemessage with the campaign’s custom message.
- The plugin forces
- If multiple campaigns want a store notice, the first active campaign wins (per request).
- If at least one campaign is active and has store notices enabled:
This does not permanently change Woo options; it’s all done via filters.
Technical Notes
- CPT:
wcas_campaign - Main class:
WCAS_Plugin - Primary meta keys (all prefixed with
_wcas_):date_mode(fixedorholiday)start_date,end_dateholiday_key,holiday_offset,holiday_durationrecurrence(none,yearly)status(manual override)discount_type,discount_valueapply_to_sale_itemsshow_countdownfree_shippinginclude_products,exclude_productsinclude_cats,exclude_catsinclude_tags,exclude_tagsstore_notice_enable,store_notice_message
Important Behaviour
get_campaign_window()is mode-aware:- Uses only fixed dates when
date_mode = fixed. - Uses only holiday+offset+duration when
date_mode = holiday.
- Uses only fixed dates when
get_campaign_status():- Applies the status override first.
- Otherwise, uses
get_campaign_window()and the current GMT timestamp to classify:unscheduled,scheduled,running, orended.
Installation
- Download the ZIP from your build/export.
- In WordPress admin, go to Plugins → Add New → Upload Plugin.
- Upload
woo-advanced-sales-campaigns.zipand activate it. - Go to WooCommerce → Sales Campaigns to create your first campaign.
- Optionally visit WooCommerce → Sales Holidays to add your own special dates.
Development
The plugin is designed to be:
- Self-contained in a single main PHP file for easy reading.
- Easy to extend via:
- Additional date strategies.
- More recurrence options.
- Custom shipping integrations consuming the
free_shippingflag.
- Safe to version-control in Git and host on GitHub alongside your other WooCommerce tools.
You can fork and modify it freely for your own sites; it was written with a bias towards clarity and debuggability over micro‑optimisation.
License
MIT
Releases
2 releases.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.