This article is related to the product: Advanced Shipping Rates for WooCommerce
Shipping rules in WooCommerce can be tricky when you have multiple product properties like cart items, weight, size, volume, price, or dates. Using comparison operators correctly ensures your shipping rules are precise, predictable, and conflict-free.
This feature offers great flexibility and fine-tuned control when setting up rules to define ranges based on any numeric property. It is available in both the free and the professional versions of the plugin. You can find the free version in the WordPress repository: Advanced Shipping Rates for WooCommerce.
In this guide, we explain how comparison operators work, how to configure the MIN and MAX switches, and how to avoid gaps or overlapping rules.
What Are Comparison Operators?
Comparison operators define how WooCommerce evaluates numeric values in shipping rules. They determine which rule applies for a given order.
Common operators include:
- ≤ (Less Than or Equal To)
- < (Less Than)
- ≥ (Greater Than or Equal To)
- > (Greater Than)
These operators are applied via two switches:
- MIN switch – defines the minimum value of the rule. Options:
- ≥ (Greater Than or Equal To)
- > (Greater Than)
- MAX switch – defines the maximum value of the rule. Options:
- ≤ (Less Than or Equal To)
- < (Less Than)
Why Comparison Operators Matter in WooCommerce shipping rules
Using comparison operators is not just about “visual clarity”. They prevent errors, such as:
- Overlapping rules that could charge customers twice
- Gaps where no rule applies
- Incorrect calculation for decimal values
For example, cart items are always integers, so gaps are less common, but for weight, volume, or price, decimal values can cause boundary conflicts if operators are not configured correctly.
Example: Comparison operators on Cart Items
Imagine two shipping rules based on the number of items in the cart:
- Rule #1: up to 4 items
- Rule #2: 5 or more items

✅ Result: Each order matches exactly one rule. Even if cart totals change, there are no gaps or overlaps.
Example: Weight-Based Shipping Rules
Other properties, such as weight, can be more confusing than simple product quantities. When defining shipping rules, it is sometimes unclear whether a boundary value belongs to one rule or the next. Decimal values add further complexity—for example, a weight of 10.5 kg could fall between two rules if the MIN and MAX operators are not set correctly. Careful configuration of comparison operators is essential to ensure that each possible value matches exactly one rule, avoiding errors or unintended overlaps.
Let’s consider these limits:
- Rule #1: 0 to 10 kg
- Rule #2: 10 kg and above
Without proper operators, an order of 10.5 kg might not match any rule or 10 kg could match two rules at the same time.
Case 1: Up to 10 kg belongs to the first rule
- Rule #1 MAX: ≤ 10 kg
- Rule #2 MIN: > 10 kg

Case 2: 10 kg and more belongs to the second rule
- Rule #1 MAX: < 10 kg
- Rule #2 MIN: ≥ 10 kg

✅ Result: 10 kg matches only the second rule.
MAX 0 Acts as a Wildcard
In Advanced Shipping Rates for WooCommerce, setting MAX = 0 acts as a wildcard, meaning “no upper limit.”
- This simplifies configuration for shipping rules that should apply from a minimum value upwards, without needing to enter an arbitrarily large number like 999999.
- It works for any numeric property or cart condition: weight, price, volume, volumetric, cart totals, and more.
✅ Using MAX = 0 as a wildcard in WooCommerce shipping rules allows ranges to extend infinitely, simplifying configurations for numeric properties like weight, price, volume, cart totals, and any other numeric property.
.
Applicable Properties for Comparison Operators
Comparison operators can be applied to the following properties:
Product properties:
- Price
- Weight
- Volume
- Volumetric
- Product dimensions
- Total (Length + Width + Height)
- Length + Girth (Length + 2×Width + 2×Height)
Cart properties:
- Number of items
- Cart totals
✅ By applying the correct combination of operators to these properties, each order will match exactly one rule, ensuring predictable shipping calculations.
How to Combine MIN and MAX Correctly
Using the right combination of MIN and MAX operators is crucial to make rules work reliably.
- MAX less than (<) operator:
- If a rule ends with MAX < X, the next rule should start with MIN ≥ X.
- This allows the same number (X) to be used in both fields safely.
- MAX less than or equal to (≤) operator:
- If a rule ends with MAX ≤ X, the next rule should start with MIN > X.
- Again, the boundaries can overlap numerically, but the operator choice ensures only one rule matches.
Examples of Correct Combinations
- Rule 1: MAX < 10 → Rule 2: MIN ≥ 10
- Rule 1: MAX ≤ 10 → Rule 2: MIN > 10
✅ This guarantees all values are covered, and no order matches multiple rules or is left unmatched.
Common Errors
- Rule 1: MAX ≤ 10 → Rule 2: MIN ≥ 10
- ❌ This configuration will match the same boundary value (10) in both rules.
- Rule 1: MAX < 10 → Rule 2: MIN > 10
- ❌ This creates a gap: an exact value (10) does not match either rule.
- Rule 1: MAX < 10 → Rule 2: MIN ≥ 10.10
- ❌ Risk: a value like 10.05 does not match either rule.
The key is to always pair MAX and MIN operators according to these rules, so every possible value matches exactly one shipping rule.
FAQ: Comparison Operators in WooCommerce
Q: Are comparison operators available in the free plugin?
A: Yes. They are available in both the free WordPress version of Advanced Shipping Rates for WooCommerce and the PRO version.
Q: How do MIN and MAX switches work?
A: MIN defines the lower boundary (≥ or >) and MAX defines the upper boundary (≤ or <). Together, they ensure each value matches only one rule.
Q: Can MAX = 0 be used as a wildcard?
A: Yes. MAX = 0 means no upper limit, simplifying setup for weight, cart total, or price.
Q: Do these operators work with decimal values?
A: Absolutely. They are essential for weight, volume, or price, where decimals can otherwise create gaps or overlaps.
Q: Can these operators be used for all properties?
A: Yes. You can use them for cart items, weight, volume, product price, cart total, and dates, making your shipping rules consistent across the store.
Q: How do I avoid double charges?
A: Always define clear MIN and MAX boundaries, choose operators carefully, and test boundary values.
Best Practices
- Use MAX = 0 instead of very large numbers
- Define clear MIN and MAX boundaries
- Decide which rule includes boundary values
- Test all numeric properties: cart items, weight, volume, price, cart total, dates
- Apply comparison operators consistently to prevent gaps and overlaps
Summary
Using comparison operators in WooCommerce shipping rules with the Advanced Shipping Rates for WooCommerce plugin (free or PRO) ensures:
- Reliable shipping rules across cart items, weight, volume, price, cart total, and dates
- Prevention of gaps, overlaps, and double charges
- Cleaner and easier-to-maintain configurations
By correctly using MIN ≥ / > and MAX ≤ / <, and leveraging MAX 0 as a wildcard, your shipping rules will work for all orders, regardless of numeric property.




