For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Field
What it matches

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

Field
What it matches

Product variants

Whether the product has variants at all.

Variant inventory

Stock level of individual variants.

Variant metafield

A variant metafield value.

Collection conditions

Field
What it matches

Collections

The collections the product belongs to.

Operators by field type

Text fields

Product title, type, vendor, option, tag.

Operator
Meaning

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.

Operator
Meaning

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

Operator
Meaning

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.

Operator
Meaning

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

Operator
Meaning

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:

all conditions (AND)

Every row must be true. Narrows the match.

Example: Product type is equal to "T-Shirt" and Product vendor is equal to "Nike" → only Nike T-shirts.

any condition (OR)

One row is enough. Widens the match.

Example: Product tag is equal to "new-arrival" or Product tag is equal to "featured" → products with either tag.

The setting applies to the whole rule — you cannot mix AND and OR within a single set of conditions. Banners use the same pattern on their Placement tab.


Next steps

Last updated

Was this helpful?