Advanced Usage
This section covers advanced RuleHook features for users who want more control, flexibility, and precision in their shipping logic.
Rule Conflicts and Priorities
When multiple rules match the same shipping method, their actions are applied in order of rule priority.
How it works
- Rules are evaluated top-down, based on their assigned priority (lower = higher priority)
- If two rules both set a shipping cost, the one with the higher priority (lower number) wins
- You can override, combine, or cancel out previous actions based on rule order
Tip: Use priority numbers to control override behavior when creating exceptions or fallback rules.
Chaining Rules
Multiple rules can apply to the same cart if all their conditions match. RuleHook does not stop after the first match unless instructed.
Example
- Rule A: Hide FedEx if weight > 10kg
- Rule B: Set cost of FedEx to $25 if country is US
If both match, and FedEx is hidden first, the second rule’s cost update will have no visible effect.
Use the evaluation logs to see which rules triggered and in what order.
Dynamic Delivery Time
You can override the estimated delivery window dynamically based on conditions.
Example
- If customer is in Zone 3, set delivery to "5–7 Business Days"
- If weekend, extend estimated delivery time by 2 days
This is useful for adjusting ETAs during sales, holidays, or logistical constraints.
Time-Based Rules
Use Day of Week or Time of Day conditions to control shipping logic on a schedule.
Examples
- Only show same-day delivery before 2:00 PM
- Hide Express methods on weekends
- Add surcharge after business hours
This allows you to align shipping visibility with warehouse or carrier availability.
Rule Testing and Simulation
Use the built-in Checkout Simulator to simulate cart scenarios before pushing rules live.
Features
- Add products, weights, and destinations
- Preview which rules apply
- See exact actions returned (set cost, hide, rename, etc.)
- Debug conflicting or missing rates
This ensures your logic behaves as expected without disrupting real customers.
Debugging Missing Rates
If no shipping rates are returned:
- Check if all shipping methods are hidden by rules
- Review priority and action conflicts
- Verify condition values (wrong postcode format, unsupported currency, etc.)
- Check store sync status (outdated methods can break evaluation)
Enable debug mode or view Evaluation Logs to trace logic flow.
Next Steps
- Learn about API Integration
- Reach out to [email protected] for advanced use cases or rule audits