Advanced Dynamic Pricing For WooCommerce

Cart Conditions

The Cart Conditions section allows you to trigger discount rules based on the contents or attributes of a customer’s cart. Unlike standard product filters that work on a per‑product basis, cart conditions evaluate the cart as a whole. They only apply inside the cart and do not affect the rest of the shop. This makes them ideal for complex promotions like “Free shipping when the cart exceeds $100”, “10% off for first‑time buyers”, or “Additional fee for high‑weight orders”.

Note: Cart conditions with an asterisk (*) are Pro version features. The free version includes a limited subset of these conditions.


Accessing the Cart Conditions Section

  1. Go to Pricing Rules → Rules in your WordPress admin.
  2. Click Add rule or edit an existing rule.
  3. Locate the Cart Conditions section (usually positioned after the product filter).
  4. If the section is collapsed, click on its header to expand it.

Configuring Multiple Conditions: AND vs. OR

When you add more than one cart condition, you must choose how the rule should evaluate them. The Condition relationship setting determines this logic.

RelationshipBehaviourExample
ANDThe rule applies only when all conditions are met simultaneously.Cart subtotal must be over $100 AND the total item count must be at least 5.
ORThe rule applies when at least onecondition is met.Cart subtotal is over $100 OR the customer uses a specific coupon code.

Select the appropriate option from the Condition relationship dropdown.


Available Cart Condition Groups

The plugin organises cart conditions into several logical groups. Each group contains specific conditions that evaluate different aspects of the cart.

Cart Group

Conditions that evaluate the cart’s overall properties:

  • Subtotal – The sum of all product prices before discounts, taxes, and shipping.
  • Subtotal excluding tax – Same as subtotal but without any taxes.
  • Total – The final cart total after all calculations.
  • Quantity – The total number of items in the cart.
  • Weight – The total weight of all products in the cart.
  • Contains product – The cart must include at least one specific product or product variation.
  • Contains product from category – The cart must include at least one product from a chosen category.
  • Contains product with tag – The cart must include at least one product with a specific tag.
  • Contains product from collection (Pro) – The cart must contain a product that belongs to a predefined Product Collection.
  • Applied coupon – The customer must use a particular coupon code.
  • Contains shipping class – The cart must contain a product with a specific shipping class.

Customer Group

Conditions that evaluate the customer’s identity or behaviour:

  • User role – The logged‑in customer must belong to a specific user role (e.g., “Wholesale Customer”).
  • User email – The customer’s email address must match a specific string (useful for testing or VIP accounts).
  • Total spent in the shop – The customer’s lifetime spending must meet a defined threshold.
  • Last order amount – The value of the customer’s most recent completed order.
  • Total spent in specified time frame (Pro) – The customer’s spending within a custom date range.
  • Is first order (Pro) – The rule applies only to first‑time buyers.
  • Selected users (Pro) – Restrict the rule to a list of specific WordPress user IDs.

Date & Time Group

Conditions that evaluate the current date and time:

  • Time – The rule applies only during a specific time window (e.g., 14:00 – 18:00).
  • Day of week – The rule applies only on specific weekdays (e.g., Monday, Friday).
  • Week of year – The rule applies only during specific calendar weeks.
  • Month – The rule applies only during specific months (e.g., December).
  • Year – The rule applies only during a specific year.
  • Date – The rule applies only on a specific calendar date.
  • Date range – The rule applies only within a defined start and end date (can also be set in the rule’s Timing section).

Cart Items Group

Conditions that evaluate individual line items or product combinations:

  • Quantity of matched product – The total quantity of a specific product selected in the product filter.
  • Quantity of matched category – The total quantity of products belonging to a specific category.
  • Quantity of matched collection (Pro) – The total quantity of products belonging to a Product Collection.
  • Sum of matched product – The total subtotal of a specific product selected in the product filter.
  • Sum of matched category – The total subtotal of products from a specific category.
  • Sum of matched collection (Pro) – The total subtotal of products from a Product Collection.
  • Product combination (Pro) – A highly flexible condition that creates a custom Boolean expression using products, categories, collections, and quantities (see Section 4 for details).

Shipping Group

Conditions that evaluate the shipping method selected by the customer:

  • Shipping method – The customer must choose a specific shipping method (e.g., “Flat Rate”, “Free Shipping”).

Customer Value Group (Pro)

Conditions that evaluate the customer’s purchasing value:

  • Total spent in the shop – Same as the Customer Group version, but placed here for convenience.
  • Last order amount – Same as above.
  • Total spent in specified time frame – Same as above.
  • Is first order – Same as above.

Product Combination (Pro Advanced Condition)

The Product combination condition is one of the most powerful Pro features. It allows you to create complex Boolean expressions to define exactly which product combinations trigger the rule.

How it works:

You can combine products, categories, and collections using logical operators (ANDOR) and specify exact quantities. For example:

  • (“Product A” AND “Product B”) OR “Category C”
  • (“Collection X” with quantity >= 2) AND NOT (“Product D”)

Typical use cases:

  • “Buy a laptop AND a mouse, get a discount on the total.”
  • “If the cart contains 3 items from Category ‘T‑Shirts’ OR 2 items from Category ‘Hoodies’, apply a bulk discount.”
  • “Discount only if the cart does NOT contain a clearance item.”

To build a condition, click the Add condition button inside the Product Combination section and start constructing your rule.


Advanced: Custom Conditions

If the built‑in conditions do not cover your specific use case, you can create a custom conditionusing PHP. The plugin provides hooks and filters that allow you to extend the condition list. This feature is intended for experienced developers.

How to create a custom condition:

  1. Use the plugin’s dedicated filter to register a new condition type.
  2. Write a callback that evaluates the condition (returns true if the condition is satisfied, falseotherwise).
  3. Optionally, add configuration fields to the rule editing screen.

For complete code examples and a step‑by‑step tutorial, refer to the custom condition developer guide.


Best Practices

  • Start with simple conditions. Build and test a rule with one condition before adding more. This makes troubleshooting easier.
  • Use the debug bar. Enable it in Settings → Debug to see exactly why a rule does or does not apply. The debug panel appears on product pages and the cart.
  • Combine cart conditions with product filters for greater control. Use product filters to select specific products, then use cart conditions to set global thresholds like subtotal or total weight.
  • Test time‑based rules thoroughly. Set a rule with a short time window (e.g., 5 minutes) and test it around the transition time to ensure it works as expected.
  • Document your complex conditions. If you build a long Product Combination expression, keep a note of its logic for future reference.

Summary

FeatureDescription
PurposeTrigger discount rules based on cart‑level attributes (subtotal, quantity, weight, etc.).
Condition relationshipChoose between AND (all conditions must be met) or OR (at least one condition must be met).
Condition groupsCart, Customer, Date & Time, Cart Items, Shipping, Customer Value, Product Combination (Pro).
Pro‑only featuresConditions marked with *, including Product Combination, Customer Value group, and selected users.
Custom conditionsDevelopers can extend the condition list with custom PHP code.
DebuggingUse the built‑in debug bar to inspect which conditions pass or fail.
CompatibilityWorks with all rule types (Product Discount, Bulk, Cart Adjustments, Free Products).

Cart Conditions are a vital tool for creating sophisticated discount rules that respond to the customer’s entire purchase. Use them to build promotions that reward higher spending, encourage specific product combinations, or offer time‑sensitive deals.

Have questions? Please submit a support request. We're always happy to help!

Advanced Dynamic Pricing
for WooCommerce
PRO

From $60
Buy
✓ 30-day money-back guarantee