Conditions
Conditions define when a rule should apply. You can set rules based on specific criteria and control how they are evaluated.
You can configure rules to apply:
- If All of the selected conditions are met (AND logic).
- If Any of the selected conditions are met (OR logic).
Conditions define when a rule should apply. You can set rules based on:
Condition Type | Description | Comparison Method |
---|---|---|
Product Title | Matches a keyword in the product title | Text-Based |
Product Description | Matches a keyword in the product description | Text-Based |
Price | Checks if the product price is greater/less than a value | Number-Based |
Type | Applies to "Simple", "Grouped", "External", "Variable" products | Specific Value (Simple , Variable , Grouped , External ) |
Days Since Created | Compares the UTC timestamp of the creation date with the current time | Number-Based |
Days Since Modified | Compares the UTC timestamp of the modified date with the current time | Number-Based |
Total Sales | Applies based on total product sales | Number-Based |
Stock Status | Applies when stock is "In Stock" , "Out of Stock" , or "On Backorder" | Specific Value (In Stock , Out of Stock , On Backorder ) |
Stock Quantity | Compares stock levels with a number | Number-Based |
On Sale | Checks if the product is currently on sale (Yes/No ) | Specific Value (Yes , No ) |
Attribute Value | Applies based on a specific attribute value | Specific Value (Select from WooCommerce attributes) |
Meta Field | Uses custom WooCommerce meta fields | Number-Based or Text-Based |
Category Names | Matches based on product categories | Category-Based |
Tag Names | Matches based on product tags | Category-Based |
Brand Name (Pro) | Matches a specific brand (Pro feature) | Category-Based |
Custom Taxonomy Name (Pro) | Applies based on a custom taxonomy (Pro feature) | Category-Based |
Comparison Methods
Text-Based Comparisons
Applies to: Product Title, Product Description, Meta Fields
Is exactly
Is exactly (case-insensitive)
Is not exactly
Is not exactly (case-insensitive)
Contains
Contains (case-insensitive)
Does not contain
Does not contain (case-insensitive)
Category & Taxonomy-Based Comparisons
Applies to: Category Names, Tag Names, Brand Name, Custom Taxonomy
Include
- Matches only if the product has a category exactly matching the provided string.Include (case-insensitive)
Do not include
- matches products that do not have any categories or tags fully matching the provided stringDo not include (case-insensitive)
Include one or more containing
- Matches if at least one of the product's categories contains the provided string (not necessarily an exact match).Include one or more containing (case-insensitive)
Do not include any containing
- matches products that have not category/s or tag/s containing the provided stringDo not include any containing (case-insensitive)
Numeric Comparisons
Applies to: Days Since Created, Days Since Modified, Stock Quantity, Price, Total Sales, Meta Fields
Is exactly
Is not exactly
Greater than
Greater than or equal to
Less than
Less than or equal to
Between
Not Between
Date Comparisons
The "Days Since Created"
and "Days Since Modified"
conditions are based on the WooCommerce timestamp fields:
- Created Date:
post_date_gmt
- Modified Date:
post_modified_gmt
These timestamps are stored in UTC time, and comparisons are done against the current UTC time. The system calculates the elapsed time by subtracting the UTC timestamp of the creation/modification date from the current UTC timestamp. Evaluation of this condition includes fractional days (at seconds resolution).
For example:
- If 3 days and 6 hours have elapsed since creation, this is evaluated as 3.25 days.
- A rule with
greater than 3
would apply, while a rule withequal to 3
would not.
This ensures precise comparisons but also means that manual edits to product timestamps may affect rule execution. Reference: WooCommerce WC_DateTime Class
Examples of Meta Fields
When using meta fields in conditions, you can select from a variety of WooCommerce product metadata options. Below is an example list of WooCommerce meta fields:
Meta Field | Description |
---|---|
_sku | Product SKU (Stock Keeping Unit) |
_price | Current product price |
_regular_price | Regular price (without discounts) |
_sale_price | Sale price (if applicable) |
_stock | Current stock quantity |
_stock_status | Stock availability (instock , outofstock , onbackorder ) |
_manage_stock | Whether stock management is enabled (yes or no ) |
_sold_individually | Whether the product is sold individually (yes or no ) |
_downloadable | Whether the product is downloadable (yes or no ) |
_download_limit | Number of times a file can be downloaded |
_download_expiry | Expiration date for downloads |
_downloadable_files | List of downloadable file links |
_virtual | Whether the product is virtual (yes or no ) |
_wc_average_rating | The product's average customer rating |
_wc_review_count | The total number of reviews for the product |
_tax_class | The tax class assigned to the product |
_tax_status | The tax status (taxable , shipping , none ) |
_thumbnail_id | The ID of the product's main image |
_product_attributes | Serialized data for product attributes |
_product_image_gallery | Serialized list of additional product images |
_product_url | External product URL (for affiliate products) |
_product_version | The version of the product |
_button_text | Custom button text for external/affiliate products |
_children | Stores child product IDs (for grouped products) |
_edit_last | The last user who edited the product |
_edit_lock | Timestamp for post lock editing |
_wc_total_sales | Total sales count for the product |
_backorders | Whether backorders are allowed (yes , no , or notify ) |
_wp_old_date | Stores the previous post date |
_wp_old_slug | Stores the previous product slug |
_wpcom_is_markdown | Determines if the product description is written in Markdown |
Additional Resources
For a full list of WooCommerce meta fields, visit the WooCommerce Developer Documentation or check the wp_postmeta
table in your WordPress database.