惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
Intezer
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
H
Heimdal Security Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
Apple Machine Learning Research
Apple Machine Learning Research
Spread Privacy
Spread Privacy
腾讯CDC
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements
V
Vulnerabilities – Threatpost
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
Google Developers Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
J
Java Code Geeks
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
Google Online Security Blog
Google Online Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
W
WeLiveSecurity
宝玉的分享
宝玉的分享
aimingoo的专栏
aimingoo的专栏
博客园_首页
S
Security @ Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recent Commits to openclaw:main
Recent Commits to openclaw:main
P
Privacy International News Feed
H
Hacker News: Front Page
Vercel News
Vercel News
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
T
Threat Research - Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
Schneier on Security
Schneier on Security
Last Week in AI
Last Week in AI
H
Help Net Security
M
MIT News - Artificial intelligence
美团技术团队

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Stop editing 500 products: rule-based discounts in WooCommerce
TivneT · 2026-05-07 · via DEV Community

My wife Lena paints. Oils, acrylics, watercolors. Flowers, landscapes, the occasional cello or violin from her music series. Each painting is its own thing, photographed and listed on her store at artbylena.com. The catalog has crept past a hundred and twenty pieces and keeps growing.

Last spring, two weeks out from Mother's Day, she decided to run a 20% sale on the flower paintings. The right move - flowers are what people buy for their mothers. She opened the WooCommerce admin and started editing each painting in the Flowers category. Set a sale price. Set a start date. Set an end date. Save. Next painting. Save. Forty-something paintings later her shoulders hurt and the spreadsheet she'd opened to keep track of the original prices was wrong in two places. On the day the sale was supposed to end, she had to do it all again in reverse: open each painting, clear the sale price, save. Another evening of clicking.

She did this once. She is not doing it again.

The default WooCommerce sale model - per-product sale price, per-product start and end date - is fine for a single product. It does not scale. It does not need to.

The reframe: a sale is a rule, not a price

Stop thinking of a sale as something you set on each product. Think of it as a rule that lives next to the products and applies on the fly:

  • Filter - which products this rule covers (category, tag, country)
  • Discount - percentage or fixed amount
  • Window - start and end dates and times
  • Priority - tiebreaker when a product matches more than one rule

Set the rule once. TIV Sales Assistant is the WooCommerce extension that implements this model: it computes the right price at display time. No prices are written to the products themselves. When the window closes, the prices revert because nothing was ever overwritten in the first place.

For Lena's Mother's Day sale, the rule is nine words long:

20% off the Flowers category from May 1 to May 11.

Two clicks (select Flowers, type 20) plus the dates. The forty-something paintings in that category are now in the sale. They stay in the sale until May 11 at midnight. On May 12 the prices revert. She doesn't log in. There is no debris in the database, because nothing was written to the paintings in the first place.

What the bulk editor doesn't do

WooCommerce's bulk product editor has a "Set sale price" action. It works for the products you select. It has two problems that matter for a catalog like Lena's:

  1. The reversion is your job. The bulk editor sets prices. It does not unset them. When the sale ends you have to remember to bulk-edit them back. If you wrote the original prices in a spreadsheet beforehand, you're already doing the wrong thing - the spreadsheet is the source of truth, and the database is a copy that's about to drift.

  2. Filters are lossy. "All flower paintings done in oil" requires you to pre-filter to oil-tagged products before the bulk action. If you forget the filter, you discount everything. There is no rule object that remembers "this sale was for oil-on-flowers"; only the products themselves remember, via their prices.

A rule-based discount system has neither problem by construction. Reversion is automatic because nothing was overwritten. Filters are part of the rule definition, persisted, and re-applied every page load.

What the workflow actually looks like

You open the Sales Assistant dashboard. You click "Add Calendar Sale." You fill in:

  • Name - "Mother's Day Flowers 20%"
  • Discount - 20%
  • Filter - category: Flowers
  • Dates - May 1 to May 11
  • Priority - 10

You save. You close the tab. You don't open the admin again until the next sale.

If you need to nudge the dates a day later, you don't open the editor - the list view's quick edit lets you change priority and dates inline. Five seconds.

If you want a second rule that bumps the discount on a subset (an extra 5% off oil paintings during the same window, say), you create a second rule with a tag filter and a lower priority. The two rules coexist. The priority field is how you tell the system which one wins for paintings that match both.

Filters that matter in practice

The three filters Sales Assistant exposes today:

  • Category - the most common discriminator. Flowers, Landscapes, Music each get their own rule.
  • Tag - finer-grained than category. Oil, acrylic, watercolor cut across categories. A flower painting in oil and a landscape in oil are in different categories but share a tag.
  • Country - based on WooCommerce's geolocation. "20% off for US and Canadian visitors during Mother's Day" without affecting UK customers, whose Mothering Sunday is in March.

The filters combine with AND logic. "Oil flower paintings, US and Canadian visitors only, May 1 to May 11" is one rule with three filters. No code, no custom fields, no conditional logic.

The catalog you don't have

The most useful thing a rule-based sale system gives you is the catalog you don't have. Lena's catalog has more than a hundred paintings today. The sale rule doesn't care how many. The Mother's Day rule keeps working as new flower paintings get added, because the filter is "category: Flowers," not a list of SKUs that gets stale.

Compare to the per-product workflow: every new flower painting added between May 1 and May 11 needs to be edited individually to be included in the sale. Or it gets missed. Either way, the work scales with the catalog. The rule does not.

What changes for the developer

If you're building a Woo store for a client, the rule-based model changes what you write down in your handoff doc.

Old handoff:

To run a sale, edit each product, set the sale price, set the dates. Use the bulk editor with these caveats: prices need to be reset by hand at the end of the sale.

New handoff:

To run a sale, open Sales Assistant -> Add Calendar Sale, fill in the discount and the filter, set the dates. Done.

That's the whole training. It fits on a sticky note. It also means the client won't call you in panic at 11pm on the day a sale was supposed to end because they forgot to revert the prices.

When the per-product model is still right

Two cases:

  1. A single hero product gets a unique price for marketing reasons. "The new commission is $499 instead of $799 for launch week." Edit the product.

  2. You're discounting irregular subsets that don't map to category or tag. A handful of paintings the artist wants to clear because they don't fit the next show. A rule with a tag filter is still cleaner if you can add a temporary tag, but if you can't, the per-product editor is fine for a handful.

For everything else - any sale that touches a category, a tag, a country, or a date range - the per-product editor is the wrong tool. It is the default tool because it shipped first and because Woo can't assume a third-party plugin is installed. It is not, on any defensible cost-benefit analysis, the tool you should reach for first.

Try it before you trust it

There's a live demo at demo-sales-assistant.tiv.net. Each visitor gets their own isolated demo - your sales don't affect anyone else's view, so you can experiment freely. Create a Mother's Day rule, watch the prices change, delete it, try it again with a tag filter. Five minutes will teach you the workflow better than the rest of this article.

The store owner two weeks out from Mother's Day, clicking through forty paintings on a Sunday evening - she's the case for rule-based discounts. The case isn't subtle. The default just hasn't caught up yet.


TIV Sales Assistant on the WooCommerce marketplace.