Articles on: Blockify - Checkout Rules

Cart attribute condition

How to block checkout with Cart attribute conditions

Overview

Cart attribute conditions let you stop a checkout when information stored in the cart is missing or wrong. For example, you can block the order when a "I agree to the terms" box was not ticked, or when a reference number does not start with the prefix you expect.
You choose the attribute name (called a key), how to compare it, and the value to look for. When the rule matches, the customer cannot complete the order and sees the error message you wrote.
Cart attribute conditions are available on the Basic plan and above. On the Free plan you can build the rule, save it as a Draft, and run it in Test Mode, but you need Basic to activate it.

Note: Blockify Checkout reads cart attributes. It does not add the checkbox or input to your store. Your theme (or another app) must already save the value in the cart. See "Before you start" below.

Before you start

A cart attribute is a small piece of information saved with the customer's cart, such as terms_accepted = yes. Your theme usually saves it from a field on the cart page. A simple example of a checkbox that saves an attribute looks like this:

<input type="checkbox" name="attributes[terms_accepted]" value="yes" form="cart"> I agree to the terms

If you are not sure whether your theme already does this, ask your theme developer. You will need the exact attribute name (for example terms_accepted) when you create the rule.

Best practices and use cases

Cart attribute conditions work best when you need the customer to confirm something before paying. Common examples:

  • Terms or legal confirmation. Block checkout when the terms box is not ticked, for example when a product needs a legal warning to be acknowledged.
  • Delivery details. Block checkout when a required note, such as a delivery instruction for bulky items, is empty.
  • Reference numbers. Block checkout when a purchase order number is missing or does not start with the format you expect.

A few tips:

  • Keep attribute names short and consistent, such as terms_accepted or po_number. You can use up to 5 different attribute names per store, so reuse the same name across rules when you can.
  • Write a clear error message that tells the customer what to do, for example "Please accept the terms before checking out."
  • Start in Test Mode, check that the rule behaves as expected, then switch it to Active.

Step-by-step guide

Step 1: Go to Blockify Checkout in your Shopify admin and open Checkout validation.
Step 2: Create a new rule and choose Cart attribute conditions.
Step 3: Under Rule status, choose how the rule should run:

  • Active: the rule blocks real customers.
  • Draft: the rule is saved but does nothing.
  • Test Mode: you can test the rule safely without affecting real customers.

If you are on the Free plan, Active is greyed out and a Basic tag appears next to Rule status. See "Activating on the Free plan" below.
Step 4: Enter a Rule name. This name is only for you and is not shown to customers.
Step 5: In the Cart attribute condition, type the Attribute key. Enter it exactly as it appears in your theme, for example terms_accepted. The key is case-sensitive, so Terms_Accepted and terms_accepted are different.
[SCREENSHOT 4: Cart attribute condition with the Attribute key, Trigger, and Value fields.]
Step 6: Choose a Trigger:

  • Equals to and Not equals to
  • Contains string and Not contains string
  • Starts with and Not starts with
  • Is empty and Is not empty

Step 7: Type the Value and click Add. To match several values, add them one by one. The rule matches if the attribute equals any of them. The value is not case-sensitive, and spaces at the start and end are ignored.
With Is empty or Is not empty, the Value field is greyed out because no value is needed.


Step 8: Under Checkout message behavior, check the Error message. A default message is filled in for you. Replace it with your own wording if you like.
Step 9: Click Save.

Note: A rule in this set needs at least one Cart attribute condition. If you remove the last one, you cannot save the rule.

[SCREENSHOT 7: Checkout page as the customer sees it, with the error message shown and the order blocked.]

Combining with other conditions

You can add more conditions to the same rule, such as Product tag, Shipping country, Billing country, Shipping method, or Cart value. Click + Add condition and set it up the same way as in other Checkout validation rules. Combining conditions follows the same plan rules as Combine Condition on your account.
Example: block the order when terms_accepted is not equal to yes AND the cart contains a product with a specific tag.

Activating on the Free plan

On the Free plan you can build and test the rule, but you need Basic to activate it.
Step 1: Click the Basic tag next to Rule status or next to Cart attribute.
Step 2: Read the message, then click Save draft and upgrade. Your rule is saved as a Draft first, so you do not lose your work.
Step 3: Choose the Basic plan on the plan page and confirm.
Step 4: Return to the rule. You will see a message that Basic is active. Select Active and click Save.


The 5 attribute names limit

Each store can use up to 5 different attribute names across all rules. Below the Attribute key field you will see how many are used, for example "4 of 5 attribute keys used. 1 key left."

  • At 4 of 5, the text turns to a warning and tells you 1 key is left.
  • At 5 of 5, you can only reuse names that are already in use.
  • If you type a new name when all 5 are used, you cannot save. The error lists the names currently in use. Use one of them, or remove a name from the other rules that use it to free a slot.


How the rule decides

  • If the attribute does not exist, or its value is empty or only spaces, it counts as empty.
  • Is empty matches when the attribute is missing. For example, "terms_accepted is empty" blocks customers who did not tick the box.
  • Not equals to, Not contains string, and Not starts with also match when the attribute is missing. For example, "terms_accepted not equals to yes" blocks customers who did not tick the box.
  • Equals to, Contains string, and Starts with do not match when the attribute is missing.
  • If a rule also uses address conditions and the customer has not entered an address yet, the rule does not block them until the address is entered and matches.

FAQ

Q: Which plans can use Cart attribute conditions? A: Basic and above can use and activate them. Free can build, save as Draft, and run in Test Mode, but cannot activate.
Q: My rule is active but it does not block anything. Why? A: Check that your theme saves the attribute in the cart and that the key in the rule matches exactly, including upper and lower case. If the key does not match, the rule treats the attribute as missing.
Q: Do Draft and Test Mode rules count toward my rule limit? A: No. Only active rules count. Active rules that use Cart attribute conditions count toward your plan's active rule limit like any other Checkout validation rule.
Q: Does it work with express checkout buttons such as Shop Pay, PayPal, or Google Pay? A: Customers who check out with an express button from a product page may skip the cart, so the cart attribute may not be saved. In that case the rule may not block the order. This is a Shopify limitation. If you need to protect those orders, add another rule that uses conditions available at checkout, such as Product or Shipping country.
Q: Can I use the same attribute key in several rules? A: Yes. Only the number of different keys is limited to 5 per store. A key is freed once no condition uses it anymore.
Q: Does my existing Checkout validation setup change? A: No. Existing rules keep working as before.

Updated on: 18/11/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!