

<strong>Rules dashboard</strong> — 8 live stat cards at the top (Total Rules, Active Rules, Inactive, Discount Rules, Fee Rules, Fee Revenue this month, Discounts Given this month, Net Impact all-time). Paginated rules table below with rule name, type badge, conditions summary, fee/discount amount, priority, live status toggle, and Edit/Delete buttons. Search box, condition-type filter, and rule-type filter in the toolbar.
DeftCoders – Discount & Fee Rules is a condition-driven pricing engine for WooCommerce. You build rules, each rule has conditions (when it fires) and an action (what it does). When a customer visits the cart or checkout, every active rule is evaluated automatically — fees and discounts are applied without any coupon codes or manual work.
Rules run in priority order. A “Stop Further Rules” flag lets any rule break the chain once it fires, giving you full control over stacking and exclusivity.
Fee Rules add charges to the cart:
Discount Rules reduce what the customer pays:
All conditions on a rule must match simultaneously (AND logic). Combine as many as needed.
Cart & Order
Customer & Checkout
Products
Date & Time (all use your WordPress site timezone)
The rules list page shows 8 live stat cards at the top: Total Rules, Active Rules, Inactive Rules, Discount Rules, Fee Rules, Fee Revenue this month, Discounts Given this month, and all-time Net Impact (fee revenue minus discounts). The revenue figures come from completed and processing orders tracked automatically.
The rules table shows 10 rules per page with full pagination. Each row shows the rule name, type badge, conditions summary, fee/discount amount, priority number, a live status toggle, and Edit/Delete buttons. Drag any row to reorder priority. A search box filters by rule name in real time. Two dropdowns filter the list by condition type or rule type.
Bulk actions at the bottom let you Activate, Deactivate, Delete, or Export any selection of rules in one click.
Test any combination of your rules without touching a real cart. Enter a simulated cart — subtotal, item count, payment method, shipping method, user role, country, coupon code, date, and time — then click Run. The results panel shows every active rule, whether it matched, which conditions were satisfied (or which one failed), the calculated amount, and a complete cart summary: subtotal, total fees, total discounts, and final total. Nothing is written to any real session or order.
Preview Mode — enable in Settings to run the full rule evaluation engine on every real cart request, but apply nothing to any actual cart. Safe to use on a live production store.
Debug Mode — writes timestamped log entries to wp-content/uploads/wcdpdr-logs/. One file per day. Each entry shows the cart state at evaluation time, every rule evaluated (conditions met or not, amount applied), any Stop Further Rules trigger, and any execution error. Logs are viewable from the Debug Logs admin page and can be cleared with one click. The log directory is protected from direct browser access by a .htaccess file written automatically on first use.
Export all rules — or a selected subset via bulk export — to a JSON file. Import on any site. Every rule is validated before saving and all fields are sanitised. The 5-rule free limit is respected automatically; imports are trimmed to available slots.
When you delete the plugin via the WordPress admin, it removes everything it created: both database tables, all plugin options, all transients, and the entire log directory. On Multisite, cleanup runs for every sub-site.
Active rules are cached in a 60-second WordPress transient; no database query fires on each cart recalculation. The cache busts immediately whenever a rule is saved, deleted, or its status toggled. Product category conditions use a single batched query across all cart products rather than one query per line item.
FeaturesUtil::declare_compatibility(); all order reads/writes use the WooCommerce order object APIwc_format_decimal() and rounded with wc_round_tax_total()