Condition operators reference
Every condition field and operator available when building targeting rules for badges.
A targeting rule is a row with three parts: a field, an operator, and a value. The operators offered depend on the field you pick — text fields get contains and starts with, numeric fields get is greater than, and so on.
You build these rows on the badge editor's Products tab, after selecting Products matching conditions.
Condition fields
The field dropdown is grouped into three sections.
Product conditions
Product title
The product's name.
Product type
Shopify's product type field.
Product vendor
The vendor name.
Product price
The current price.
Product compare price
The compare-at price.
Product sale price
The discounted price.
Product option
A product option such as size or color.
Product tag
Any tag on the product.
Product weight
The product's weight.
Product created
How long ago the product was created, in days.
Product published
How long ago the product was published, in days.
Product inventory
Stock level and stock status.
Product metafield
A product metafield value.
Variant conditions
Product variants
Whether the product has variants at all.
Variant inventory
Stock level of individual variants.
Variant metafield
A variant metafield value.
Collection conditions
Collections
The collections the product belongs to.
Operators by field type
Text fields
Product title, type, vendor, option, tag.
is equal to
Exactly matches the value you enter.
is not equal to
Does not match the value.
starts with
Begins with the text you enter.
ends with
Ends with the text you enter.
contains
Includes the text anywhere within it.
does not contain
Does not include the text.
Numeric fields
Product price, compare price, sale price, weight.
is equal to
Exactly the number you enter.
is not equal to
Any number except the one you enter.
is greater than
Above the number you enter.
is less than
Below the number you enter.
Inventory
in stock
The product currently has inventory.
out of stock
Inventory has reached zero.
continue selling when out of stock
The product is set to keep selling past zero.
stock availability is greater than
Stock is above the threshold you enter.
stock availability is less than
Stock is below the threshold you enter.
The first three take no value — the operator is the condition.
Date fields
Product created, Product published. The value is a number of day(s) counted back from today, not a calendar date.
is less than
Created or published fewer than N days ago — use this for "new arrival" badges.
is greater than
Created or published more than N days ago.
is in range
Falls between two day counts.
Product variants
is equal to / is not equal to
Compares against a specific variant count.
products with variants
The product has more than one variant.
product has no variants
The product has only the single default variant.
Combining conditions
Add as many rows as you need with Add conditions, then use the Products must match radio above them to decide how they combine:
Next steps
Target products by attribute — set up attribute conditions step by step.
Target specific products — hand-pick individual products instead.
Plan comparison — check which conditions your plan includes.
Last updated
Was this helpful?