Skip to main content

Understanding merchandising expressions

Expressions are powerful 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. This means pinned products always appear first, followed by products matching expressions, and finally all remaining products sorted by the base sort order.

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
  • contains / does not contain - Partial text matching
  • begins with / does not begin with - Prefix matching
  • ends with / does not end with - Suffix matching
  • 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)
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)
  • 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

Let’s say you want to group products in your “New Shoes” collection by product type, while using the “Best-selling” sort order:
Expressions:
1. product_type = Sneakers
2. product_type = Sandals
3. product_type = Boots
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

Expressions at a glance

Expressions automatically group products (for example by type, brand, or price range) so you can present curated blocks that still respect your selected base sort within each group. Use them alongside pinned products for a balanced strategy.

See also