Cart block
Show Cart Validator's message on the Shopify cart page before checkout: add the Cart rule message block, what it checks and its settings.
The Cart rule message block shows the message on your cart page as soon as the cart breaks one of your rules, so buyers can fix the cart before they reach checkout. It needs an Online Store 2.0 theme and works on the cart page, not in a cart drawer. Without the block, checkout still checks every rule.
Adding the block
You place the block in the theme editor. Nothing in your theme's code changes. You can also add it yourself: in the theme editor, open the cart page, add a block and choose Cart rule message from the apps.
- 1
Open the theme editor
On the Overview, select Cart block under Cart and checkout. The theme editor opens your cart page with the Cart rule message block added.
- 2
Move it into place
Move the block to where buyers should see the message, for example near the checkout button, then select Save in the theme editor.
Back in the app, the Cart block row shows Added. Not added means the block isn't in a theme yet. Unavailable means the block is there but switched off, so buyers don't see it.
What the block checks
The block works out the message in the buyer's browser, from your rules and the cart, so showing it needs no request to our servers. It checks the cart when the page loads and again whenever Shopify reports a cart change on the page, then updates the message, or hides it once the cart passes. It shows one message: the first rule the cart breaks.
The cart doesn't know everything checkout knows, so the block checks a little less:
| What | In the cart block | At checkout |
|---|---|---|
| Country | The country your store is set to for the buyer, for example through your country selector. | The delivery address, once the buyer enters it. |
| Value rules | Rules on the Subtotal. | Rules on the Subtotal and on the Total. |
| Customer tags | Rules limited by customer tag aren't shown. | Checked. |
| Language | Your storefront's language. | The checkout's language. |
So a cart without a message can still stop at checkout, for example when the buyer enters an address in another country. The block shows nothing while the cart is empty, no plan is active, Validate carts at checkout is off or no rule is on.
Block settings
Select the block in the theme editor to change how it looks. The text comes from the app's buyer messages, the font and the text colour from your theme, and the box takes the corner radius of your theme's input fields.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Show an icon | An exclamation mark in a circle before the message | On or off | On |
| Show as a box | Puts the message in a box with padding and rounded corners | On or off | On |
| Accent color | The icon and the box | Any colour | Your theme's text colour |
| Box color | The box's fill | Any colour | The accent colour at 8 % |
| Alignment | Where the icon and the text sit | Left, Center or Right | Left |
| Text size | The size of the message, relative to your theme's text | 80–140 % | 100 % |
| Top | The space above the block, under Margin | 0–40 px | 16 px |
| Bottom | The space below the block, under Margin | 0–40 px | 16 px |
In the theme editor
When the block has nothing to show, the theme editor tells you why. Buyers never see these hints.
| Hint | Meaning |
|---|---|
| No message yet – the cart is empty. | Add a product to the cart to preview the block. |
| No rule is checked here yet. Turn on cart validation and at least one rule in the Cart Validator app, and choose a plan. | No plan is active, Validate carts at checkout is off or no rule is on. See Troubleshooting. |
| This cart meets your rules. When a cart breaks one, its message appears here. | The cart passes every rule the block checks. |
The hints are in your storefront's language, and the block's name and settings follow your admin's language.