Build your cart

Display rules

Give a module a set of conditions, so it only appears for the shoppers you choose.

What a display rule is

By default, a module shows to every shopper whenever it is switched on. A display rule narrows that. You can show the upsell only on carts over $50, show a free-gift bar only to shoppers in one country, or hide an announcement on phones.

Two things are worth knowing before you start.

Display rules are part of the Launch plan ($14.99 a month). If you are on the Free plan, the screen still opens and still shows you any rule you already have — what is refused is saving.

Add a rule to a module

  1. Open your cart, then open the module you want to control.
  2. Scroll to Who sees this.
  3. Click Add a display rule. If the module already has one, the button reads Edit display rule and shows how many conditions it has.
  4. On the rules screen, set Match to either All of these conditions or Any of these conditions.
  5. In the row underneath, pick a fact from When, pick a comparison from Is, and type into Value.
  6. Click Save rule. You will see a Rule saved message.
  7. Read the sentence at the top of the screen under What this does. This is the app telling you back, in English, exactly what it will do.
  8. Read How often this would have fired, which appears once a rule is saved.
  9. Publish the cart. Saving a rule does not change your storefront on its own — the rule goes live when you publish, and it appears in the publish comparison as Display rules.

The form always shows one spare empty row. So you add one condition, save, and a fresh empty row appears for the next one. Building a five-condition rule takes five saves.

The form

FieldWhat it does
MatchAll of these conditions means every condition has to be true. Any of these conditions means one is enough.
WhenThe fact you are testing — cart total, country, device, and so on. The full list is below. Choosing — remove this condition — drops that row when you save.
IsThe comparison. These are shown as short codes; the table below says what each one means.
ValueWhat you are comparing against. A plain text box — there is no product picker or country picker here.

The facts you can test

These eleven are what the When menu offers. The last two columns matter and are explained further down.

WhenChecksEstimate can test itSafe for a discount
Cart totalThe cart value, typed in your store's own currencyYesYes
Number of itemsHow many items are in the cartYesYes
Cart contains product IDA numeric Shopify product IDYesYes
Cart contains product handleA product handle, such as winter-coatYesYes
Cart contains vendorThe vendor name on a productYesYes
Cart contains a gift cardWhether any line is a gift cardYesYes
Shopper is logged inWhether the shopper is signed in to an accountNoYes
Shopper's countryA two-letter country code, such as USYesYes
Shopper's devicemobile, tablet or desktopNoNo
Page addressThe web address the shopper is onNoNo
Page typeThe kind of page, such as a product or collection pageNoNo

What the "Is" codes mean

CodeMeaning
eqis exactly
neqis not
gtis more than
gteis at least
ltis under
lteis at most
inis one of
not_inis none of
containscontains this text
starts_withstarts with this text
matches_anymatches a pattern, where * stands for anything. /collections/sale* matches every page under that address.

The in and not_in codes only handle one value when you type it here. A comma-separated list such as US,CA is treated as a single piece of text and will never match. To cover two countries, set Match to Any of these conditions and add one condition per country.

Amounts and currency

Type Cart total in your store's own currency — 50 means fifty, not fifty cents. A shopper paying in another currency has their cart converted at Shopify's rate before the rule is checked, so a $50 rule is $50 to you wherever they are.

The two true-or-false facts

Cart contains a gift card and Shopper is logged in work differently from the rest. Type true or false in the Value box. Anything else, including an empty box, is read as false. Whatever you pick under Is is ignored for these two.

Check what you built

Two checks sit above the form, and they are the reason this screen exists. A rule that is valid, reads correctly, and quietly does the wrong thing is the failure that is hardest to notice.

What this does

The app restates your rule as a sentence, such as "Show Product upsell when the cart total is at least $50.00 and the shopper is logged in." Read it. If it does not describe what you meant, the rule is wrong, no matter how the form looks.

If you have no rule at all, the sentence says the module is shown to everyone whenever it is switched on.

If the rule ends up with no conditions, you get a red This rule cannot match anything warning. An empty rule hides the module from everybody rather than showing it to everybody. Add a condition, or clear the rule.

One phrasing is worth reading twice. A negative condition on cart contents is read as "the cart does not contain this" — not "some item in the cart is not this". So Cart contains product handle with neq means the whole cart is free of that product. That is what the sentence says, and it is what the storefront does.

How often this would have fired

Once a rule is saved, the app tests it against your last 100 orders and tells you how many it would have matched. "Matches nothing" is the most common way targeting goes wrong, and it goes wrong silently — no error, nothing to search for.

You will see one of these:

The app refuses to give a number, rather than guessing, when:

The estimate counts orders, not carts. Orders are the carts that were completed, which is a better-behaved group than all your carts by definition. Treat the number as a guide to whether the rule is sane, not as a measurement of your carts. The screen says "orders" everywhere for exactly this reason.

Two details: the figure uses each order's subtotal for Cart total, and the country comes from the order's shipping address.

Rules and discounts

If your rule uses Shopper's device, Page address or Page type, a Display only banner appears.

Those three facts live in the shopper's browser, and a shopper can change what their own browser says. That is fine for deciding whether to show or hide a module — the worst case is somebody sees a banner. It is not fine for giving money away, because anyone could edit those values and claim the discount. Shopify's servers, where a discount is checked, cannot see them at all.

The banner is information, not a block. You can still save and use the rule to show or hide the module.

Removing a rule

Set every condition's When menu to — remove this condition — and click Save rule. You will see Rule removed — this module now shows to everyone, and the module goes back to showing whenever it is switched on. Publish the cart to put that live.

If saving is blocked

A warning banner at the top of the screen, with a See plans button, means one of two things.

Either way, the rule you already have keeps working and stays readable. If you are testing on a Shopify development store, everything is unlocked.

Limitations

Things a merchant would reasonably expect that are not there today:

Saving a rule does not change your storefront. Rules travel with the rest of your cart settings and go live only when you publish — see Publishing. If a module is not appearing when you expect it to, Troubleshooting covers the usual causes.