Product conditions decide which products a rule changes. You add them in a rule's Products section (Products - Buy and Products - Get in Buy x get y rules, entries of a Product Group), and in the Items section of cart discounts and checkout fees (shown with the per cart item and per cart line methods). When you add several, a product must match all of them.
With no product conditions, a product pricing rule applies to all products ("Applies to all products.") and a cart discount or fee to all items ("Applies to all items."). In cart discounts and checkout fees at least one cart item has to match the Items conditions for the rule to apply, and only the matching items are counted. See how conditions work.
Where can you use these conditions?
| Condition | Product pricing | Cart discounts | Checkout fees |
|---|---|---|---|
| Product | Products / Products - Buy, Products - Get, Product Group | Items | Items |
| Product variation | Products / Products - Buy, Products - Get, Product Group | Items | Items |
| Product category | Products / Products - Buy, Products - Get, Product Group | Items | Items |
| Product attributes | Products / Products - Buy, Products - Get, Product Group | Items | Items |
| Product tags | Products / Products - Buy, Products - Get, Product Group | Items | Items |
| Product regular price | Products / Products - Buy, Products - Get | Items | Items |
| Product sale price (since 2.6.0) | Products / Products - Buy, Products - Get | Items | Items |
| Product is on sale | Products / Products - Buy, Products - Get | Items | Items |
| Product stock quantity | Products / Products - Buy, Products - Get | Items | Items |
| Product total sales (since 2.6.0) | Products / Products - Buy, Products - Get | Items | Items |
| Product shipping class | Products / Products - Buy, Products - Get | Items | Items |
| Product weight, length, width, height (since 2.6.0) | Products / Products - Buy, Products - Get | Items | Items |
| Product metadata | Products / Products - Buy, Products - Get | Items | Items |
| Cart item data | Products / Products - Buy | Items | Items |
| Any pricing rule applied | no | Items | no |
| Coupons applied | Products / Products - Buy, Products - Get | Items | Items |
Product conditions
Product conditions select products by what they are: the product itself, a variation, categories, attributes and tags. They are used in the product sections of rules (Products, Products - Buy, Products - Get, Product Group, and Items in cart discounts and checkout fees).
Product
The product. Variations match through their parent product, so selecting a variable product covers all its variations.
- Fields: Products (search and select)
- Operators: "in list", "not in list"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get, Product Group); Cart discounts (Items); Checkout fees (Items)
- Example: Products: Product in list "Hoodie" to discount only that product.
- Search by name or SKU, or by ID for products without a SKU; up to 50 products are listed, not counting the ones already selected.
- Use Product variation to target single variations.
Product variation
The variation in the cart or on the product page.
- Fields: Product variations
- Operators: "in list", "not in list"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get, Product Group); Cart discounts (Items); Checkout fees (Items)
- Example: Product variation in list "Hoodie - xxl (HD-XXL)" for a size surcharge with a Simple adjustment Fixed fee.
- Search by product name or SKU, or by ID for variations without a SKU (their own or their product's); up to 50 variations are listed, not counting the ones already selected.
- Simple products have no variation: in list never matches them, not in list always does.
Product category
The categories of the product (of the parent product for variations).
- Fields: Product categories (child categories included)
- Operators: "in list", "not in list"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get, Product Group); Cart discounts (Items); Checkout fees (Items)
- Example: Product category in list "Shirts".
- Selecting a parent category also matches products in its child categories.
Product attributes
The attribute terms of the product. For a variation, its own attribute values (the options chosen) are used for variation attributes.
- Fields: Attribute terms
- Operators: "at least one of selected", "all of selected", "only selected", "none of selected"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get, Product Group); Cart discounts (Items); Checkout fees (Items)
- Example: Product attributes at least one of selected "Color: Red" (discounts by attribute).
- Uses global attributes (Products > Attributes); custom per-product attributes have no terms to select.
Product tags
The product tags (of the parent product for variations).
- Fields: Product tags
- Operators: "at least one of selected", "all of selected", "only selected", "none of selected"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get, Product Group); Cart discounts (Items); Checkout fees (Items)
- Example: Product tags at least one of selected "clearance".
Product Property conditions
Product property conditions select products by their data: regular and sale price, sale status, stock, units sold, shipping class, weight and dimensions, and custom fields.
Product regular price
The regular price entered for the product or variation (not the sale price).
- Fields: Amount
- Operators: "at least", "more than", "not more than", "less than", "equals", "does not equal"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product regular price at least 100 to discount only expensive products.
- Products without a regular price never match.
Product sale price
New in 2.6.0. The WooCommerce sale price entered for the product or variation, while the product is on sale.
- Fields: Amount
- Operators: "at least", "more than", "not more than", "less than", "equals", "does not equal"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product sale price at least 50, for an extra 5% off sale items that still cost 50 or more.
- It reads the sale price saved on the product or variation, not a price after Pricepep's rules.
- The value counts only while the product is on sale as Product is on sale sees it: below the regular price and within the sale's dates. A sale price saved for a sale that hasn't started or has ended doesn't match any operator, and neither does a product without a sale price.
Product is on sale
Whether the product or variation is on sale the way WooCommerce sees it: a sale price below the regular price, within the sale's dates.
- Fields: none (choose yes or no)
- Operators: "yes", "no"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product is on sale no, to keep a rule away from sale items.
- Only a sale price saved on the product counts. A price lowered by a Pricepep rule doesn't, even where the shop shows that product with a crossed-out price and a sale badge.
- A scheduled sale counts only from its start date to its end date, so a rule for products not on sale keeps applying until the sale starts.
- Rules normally check the variation or the product in the cart; when a variable or grouped product itself is checked, only a sale price saved on that product counts.
- To exclude sale items from all product pricing rules, see Settings > Base price for products on sale.
Product stock quantity
The stock quantity of the product or variation.
- Fields: Number
- Operators: "at least", "more than", "not more than", "less than", "equals", "does not equal"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product stock quantity more than 50 for an overstock discount.
- Only products that manage stock have a quantity; others never match.
Product total sales
New in 2.6.0. How many units of the product the store has sold, as WooCommerce counts them: the same sales count WooCommerce sorts products by with "Sort by popularity".
- Fields: Number
- Operators: "at least", "more than", "not more than", "less than", "equals", "does not equal"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product total sales less than 100, for a launch price on the first 100 units sold.
- Store-wide and all time, for all customers. WooCommerce adds the units when an order becomes Processing, Completed or On hold, and takes them off when such an order is cancelled, trashed or deleted; refunds don't lower it.
- Variations use the count of their variable product, because WooCommerce counts sales on the parent product.
- A product with no sales counts as 0. When the count changes, Pricepep clears the product's cached shop prices, so shop and product pages show the new price (a page cache may still need clearing; see caching).
Product shipping class
The shipping class of the variation, or of the parent product when the variation has none.
- Fields: Shipping classes
- Operators: "in list", "not in list"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product shipping class in list "Bulky" for a handling fee per item.
- Products without a shipping class have no value (not in list matches them).
Product weight
New in 2.6.0. The weight of the product or variation, in the weight unit set in WooCommerce. The condition's name shows the unit, for example "Product weight (kg)".
- Fields: Amount (decimals allowed, such as 0.5)
- Operators: "at least", "more than", "not more than", "less than", "equals", "does not equal"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product weight (kg) at least 20, under Items of a checkout fee with Fixed fee per cart item, for a handling fee on heavy items.
- A variation uses its own weight, or the variable product's when it has none (as WooCommerce shows it).
- Products without a weight have no value and match no operator: "less than 2" doesn't match them.
- This is each item's own weight; for the whole cart use Cart total weight (cart conditions).
Product length, Product width, Product height
New in 2.6.0. The dimensions of the product or variation, in the dimensions unit set in WooCommerce, for example "Product length (cm)".
- Fields: Amount (decimals allowed)
- Operators: "at least", "more than", "not more than", "less than", "equals", "does not equal"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product length (cm) more than 120, for a fee on long items.
- Like weight: a variation's own value, else the variable product's; products without the value match no operator.
The units are the Weight unit and Dimensions unit in WooCommerce > Settings > Products. If you change them, WooCommerce doesn't convert the values saved on products, and Pricepep compares the numbers as they are.
Product metadata
A custom field (post meta) of the product: enter the meta key in "data key" and the value to compare.
- Fields: Key (placeholder "data key"); Value (placeholder "value"; hidden for is empty, is not empty, is checked and is not checked)
- Operators: "is empty", "is not empty", "contains", "does not contain", "begins with", "ends with", "equals", "does not equal", "less than", "less or equal to", "more than", "more or equal to", "is checked", "is not checked"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Product metadata "_supplier" equals "acme" (discounts by a custom field).
- For weight and size, use Product weight, Product length, Product width and Product height (since 2.6.0): they read a variation's own value, which Product metadata doesn't.
- Checks the parent product's value first, then the variation's.
- WooCommerce's own fields can be used by their meta key, for example _price, _regular_price, _sale_price, _visibility, _virtual (yes/no), _downloadable (yes/no), _wc_average_rating, _wc_review_count; they are read through WooCommerce, so they work with any product storage.
- Text comparisons are case-sensitive.
Other conditions
These product-level conditions look at the cart item rather than the product: data stored with the cart item, whether a pricing rule changed it, and coupons.
Cart item data
A value stored with the cart item by WooCommerce or another plugin (for example product add-ons): enter the cart item data key and the value.
- Fields: Key (placeholder "data key"); Value (placeholder "value"; hidden for is empty, is not empty, is checked and is not checked)
- Operators: "is empty", "is not empty", "contains", "does not contain", "begins with", "ends with", "equals", "does not equal", "less than", "less or equal to", "more than", "more or equal to", "is checked", "is not checked"
- Available in: Product pricing rules (Products / Products - Buy); Cart discounts (Items); Checkout fees (Items)
- Example: Cart item data "gift_wrap" is checked.
- Only cart items have this data. Shop prices (Settings > Change display prices in shop) are calculated without it.
- Text comparisons are case-sensitive.
Any pricing rule applied
Whether a product pricing rule changed the price of this cart item.
- Fields: none (choose yes or no)
- Operators: "yes", "no"
- Available in: Cart discounts (Items)
- Example: Items: Any pricing rule applied no, so a cart discount only goes to items without a product discount.
- Cart discounts only.
Coupons applied
Coupons applied to the cart that are valid for this item.
- Fields: Coupons (type the start of the code to search; up to 50 coupons are listed, not counting the ones already selected, so type more to narrow it down; hidden for "at least one of any" and "none at all")
- Operators: "at least one of any", "at least one of selected", "all of selected", "only selected", "none of selected", "none at all"
- Available in: Product pricing rules (Products / Products - Buy, Products - Get); Cart discounts (Items); Checkout fees (Items)
- Example: Coupons applied at least one of selected "VIP" to give coupon holders a better product price.
- Pricepep's own cart discounts are not coupons for this condition.
What do the operators mean?
| Operator | Matches when |
|---|---|
| in list | Matches when the value is one of the selected items (for values with several items, such as the categories of a product: when at least one of them is selected). |
| not in list | Matches when none of the values is selected, including when there is no value at all (for example a guest for Customer, or a simple product for Product variation). |
| Operator | Matches when |
|---|---|
| at least one of selected | At least one selected item is present. |
| all of selected | Every selected item is present (others may be present too). |
| only selected | The values are exactly the selected items: every selected item is present and nothing else (for categories and attributes, child terms of a selected term count as that term). |
| none of selected | None of the selected items is present. |
| Operator | Matches when |
|---|---|
| at least | The value is the number or more. |
| more than | The value is more than the number. |
| not more than | The value is the number or less. |
| less than | The value is less than the number. |
| equals | The value is the number (since 2.6.0). Prices (Product regular price, Product sale price) are compared at your store's price decimals, or at the number's own decimals when it has more. Stock quantities and sales counts must match exactly. Weight and dimensions are compared at 3 decimals, or at the number's own decimals when it has more, so a weight of 1.204 doesn't equal 1.2. |
| does not equal | The value isn't the number, compared as for equals (since 2.6.0). Like the other number operators, it doesn't match when there is no value at all. |
| Operator | Matches when |
|---|---|
| yes | The property is true. |
| no | The property is false. |
| Operator | Matches when |
|---|---|
| is empty | No value, or an empty value. |
| is not empty | A non-empty value. |
| contains | The value contains the text (case-sensitive). |
| does not contain | The value does not contain the text (also matches when there is no value). |
| begins with | The value begins with the text. |
| ends with | The value ends with the text. |
| equals | The value is exactly the text. |
| does not equal | The value is not the text (also matches when there is no value). |
| less than | The value is a number less than the one entered. |
| less or equal to | The value is a number up to the one entered. |
| more than | The value is a number more than the one entered. |
| more or equal to | The value is a number from the one entered up. |
| is checked | The value is not empty or 0, for example yes, 1 or true. "no" counts as checked too: for yes/no fields use equals yes. |
| is not checked | Empty, 0 or no value. |
| Operator | Matches when |
|---|---|
| at least one of any | Any coupon is applied (no coupon field). |
| at least one of selected | At least one of the selected coupons is applied. |
| all of selected | All selected coupons are applied. |
| only selected | Only the selected coupons are applied (all of them, and no other). |
| none of selected | None of the selected coupons is applied. |
| none at all | No coupon is applied (no coupon field). |
Related
- How conditions work
- Cart conditions
- Custom taxonomy conditions (brands)
- Simple adjustment
- Product pricing rules
Frequently asked questions
How do I apply a rule to a whole category?
Add Product category, in list, and select the category in the rule's Products section. Products in its child categories match too.
Does the Product condition include variations?
Yes. Selecting a variable product matches all its variations. Use Product variation to target one variation.
How do I keep a rule away from products on sale?
Add Product is on sale with no. To keep all product pricing rules away from sale items, set Settings > Base price for products on sale to Exclude products already on sale.
Can I use brands in conditions?
Yes. Enable the brand taxonomy in Settings > Enabled custom taxonomy conditions; it then appears in the Custom Taxonomy group.