Pricing Rules for WooCommerce: evaluation
20,000 random carts against random rule sets of every type: sales, bulk tiers, buy-X-get-Y and cart thresholds, with priorities, scopes, roles, schedules, exclusivity and discount caps.
0of 20,000 carts differ from the independent reference
10/10planted bugs caught by that comparison
29% → 0cart discounts a cent off: rounding each line vs largest remainder
2.58 msp95 for 50 lines × 1,000 units and 20 rules
Gate: 8 / 8
| Check | value | target | |
|---|---|---|---|
| Carts where the engine differs from the independent reference | 0 / 20000 | = 0 | ✓ pass |
| Planted bugs caught by that comparison | 10 / 10 | = all | ✓ pass |
| Items priced below their floor or below zero | 0 | = 0 | ✓ pass |
| Carts whose lines do not add up to the total | 0 | = 0 | ✓ pass |
| Carts whose per-rule savings do not add up | 0 | = 0 | ✓ pass |
| Cart discounts off by a cent or more | 0 / 5000 | = 0 | ✓ pass |
| Negative prices from stacked percentages | 0 / 5000 | = 0 | ✓ pass |
| p95 time, 50 lines × 1,000 units, 20 rules | 2.58 ms | ≤ 25 ms | ✓ pass |
Planted bugs
- ✓ round down instead of half up
- ✓ BOGO discounts the dearest unit
- ✓ BOGO ignores the group limit
- ✓ floor not enforced
- ✓ exclusive does not lock
- ✓ cart leftover cents dropped
- ✓ cart threshold uses >
- ✓ bulk counts all lines together
- ✓ priority order reversed
- ✓ rule end date inclusive
Common shortcuts
| Shortcut | carts affected | this engine |
|---|---|---|
| Cart discount spread by rounding each line | 29% | 0 |
| Percentages stacked by adding (price below zero) | 49.1% | 0 |
Speed with 20 rules: engine (buckets of identical units) vs unit-by-unit reference, median
| Cart | units | engine | reference |
|---|---|---|---|
| 5 lines × 3 | 15 | 0.124 ms | 0.21 ms |
| 20 lines × 10 | 200 | 0.436 ms | 2.92 ms |
| 50 lines × 1000 | 50,000 | 1.566 ms | 1845.59 ms |