Skip to main content
You can create multiple merchandising rules targeting the same collection and sort order combination. This enables sophisticated merchandising strategies where different rules apply based on contextual conditions or time windows.

First-match-wins evaluation

When multiple rules target the same collection/sort combination, the system uses a conditions-first evaluation order: rules with contextual conditions are always evaluated before rules without conditions (default/catch-all rules). Among rules of the same type, evaluation follows creation order. This means a default rule will never block a more specific conditional rule from matching, regardless of when each rule was created. Example scenario:
Rule 1 (created first): No conditions → Default merchandising for all visitors
Rule 2: US visitors → Show US-specific merchandising
Rule 3: UK visitors → Show UK-specific merchandising
Even though the default rule was created first, the system evaluates Rules 2 and 3 before Rule 1. A visitor from the US sees Rule 2, a UK visitor sees Rule 3, and all other visitors fall through to Rule 1.
Among rules that all have contextual conditions, evaluation follows creation order. The same applies among default rules. If you need to change precedence between rules of the same type, recreate them in the desired order.

Overlap detection

To prevent conflicting merchandising rules, the system validates that contextual conditions don’t overlap. This ensures that only one rule can match a given visitor at any time.

Real-time overlap warnings

As you edit contextual conditions in the merchandising sidebar, Layers checks for overlaps in real time. If your conditions conflict with an existing rule, a warning toast appears immediately — before you save. The warning identifies the conflicting rule by name and includes a View rule link so you can navigate directly to it and adjust either rule’s conditions. This lets you resolve conflicts while you work, rather than discovering them only when you attempt to save.

Save-time validation

When you save a rule, Layers performs a final overlap check. If the conditions still overlap with an existing rule, the save is blocked and you see an error message identifying the conflicting rule.

What constitutes overlapping conditions

The system analyzes the contextual conditions of all existing rules for the same collection/sort combination and determines if the new rule’s conditions could match the same visitor as an existing rule. Non-overlapping conditions (allowed):
  • country == US and country == CA (different equality values)
  • country in [US, CA] and country in [UK, DE] (no common values)
  • source == klaviyo and source == google (different marketing sources)
Overlapping conditions (blocked):
  • country == US and country == US (identical conditions)
  • country in [US, CA] and country in [CA, UK] (common value: CA)
  • country == US and country in [US, CA] (US is in the list)
  • country == United States and country contains United (the exact value contains the substring)
  • country == United States and country begins with United (the exact value starts with the prefix)
  • country in [US, CA] and country contains C (a list value contains the substring)
The overlap detection uses heuristic analysis and may not catch all complex overlapping scenarios with deeply nested OR conditions. The validation provides best-effort protection while allowing legitimate non-overlapping rules to coexist.

See also