Skip to main content

Understanding merchandising expressions

Merchandising expressions are rules that automatically sort products based on attributes like product type, vendor, price, or any other filterable attribute in your catalog.
Expressions are applied after manual/conditional pins and before the primary sort order. Pinned products always appear first, followed by products matching expressions, and finally all remaining products sorted by the base sort order.

Expression types

In a merchandising rule’s Expressions tab, you can add four types of expressions:
  • Promote — Forces matching products toward the top, in the order of your expressions.
  • Demote — Forces matching products toward the bottom.
  • Soft Boost — Nudges matching products up within the base sort without clustering them. See Soft boost expressions.
  • Product Diversity — Limits how many products from the same group appear near the top. See Diversity expressions.
The steps and example below describe Promote expressions.

How expressions work

  1. Dynamic Linking products appear first (if applied via Browse API on page 1)
  2. Manually pinned products appear next
  3. Products matching your expressions appear in the order of the expressions
  4. Within each expression group, products are sub-sorted by your selected base sort order
  5. Products not matching any expression follow at the end, sorted by the base sort order

Available operators

When building expressions, you can use various operators depending on the attribute type: Text operators:
  • equals / does not equal - Exact match comparison (case-insensitive)
  • contains / does not contain - Partial text matching (case-insensitive)
  • begins with / does not begin with - Prefix matching (case-insensitive)
  • ends with / does not end with - Suffix matching (case-insensitive)
  • in / not in - Match any value in a list (case-insensitive; multi-select enabled in UI)
  • is null / is not null - Check if attribute has a value (no value field shown in UI)
String comparisons in expressions are case-insensitive across every operator. A rule matching "sale" also matches "Sale" and "SALE". Numeric and boolean equality stays exact.
Numeric operators:
  • equals / does not equal - Exact numeric match
  • greater than / greater than or equal - Value comparisons
  • less than / less than or equal - Value comparisons
  • between / not between - Range matching (requires two values)
  • in / not in - Match any value in a list (multi-select enabled in UI)
  • is null / is not null - Check if attribute has a value (no value field shown in UI)
Date operators:
  • equals / does not equal - Exact date match
  • after / before - Date comparisons
  • between / not between - Date range matching (requires two values)
  • is null / is not null - Check if attribute has a value (no value field shown in UI)
Tag operators:
  • contains / does not contain - Check if tag exists
  • in / not in - Match any tag in a list (multi-select enabled in UI)
When you select is null or is not null operators, the value field is automatically hidden in the UI since these operators check for the presence or absence of data without requiring a comparison value.

When to use null operators

The is null and is not null operators are useful for filtering products based on whether an attribute has been set: Example use cases:
  • vendor is not null - Only show products that have a vendor assigned
  • compare_at_price is null - Show products that are not on sale (no compare-at price set). For a stricter check that requires the compare-at price to be greater than the price, use on_sale equals false. See On-sale attributes.
  • metafield.custom.featured_until is not null - Show products with a featured end date configured
  • tags is null - Show untagged products that need categorization

Example use case

Say you want to group products in your “New Shoes” collection by product type, while using the “Best-selling” sort order:
Result:
  • All Sneakers appear first, sub-sorted by best-selling rank
  • Then all Sandals, sub-sorted by best-selling rank
  • Then all Boots, sub-sorted by best-selling rank
  • Finally, any remaining shoes (like Slippers or Loafers) sorted by best-selling rank

See also