NEWDiscoverShipGoal– turn cart progress into bigger baskets
All articles

Use Shopify line item properties and cart attributes to check information added to a customer's cart. In BlockCart, these conditions let you match an attribute's key and value, then show your error message when the rule matches.

Cart attributes and line item attributes

Attributes are extra details stored as a key and value. For example, a delivery date app might add a cart attribute with the key delivery_date and a date as its value. A gift note could be stored as a cart attribute, while a custom option for one product could be stored on that item's cart line. Check how your store or app saves the detail before choosing a condition.

| Condition | What it checks | Rule input | | ------------------------ | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | | Cart attribute | The value of a named attribute on the cart. | Attribute input | | Cart items attribute | The value of a named attribute on any cart line. This is the choice for line item properties. | Standard input, Shipping input, or Attribute input |

TODO screenshot: Cart attribute and Cart items attribute choices in the checkout rule condition picker

Enter the key and value

Select the condition, choose a comparison, then fill in Attribute key and Attribute value. The key must be the name used by your store or the app that adds the attribute. For a cart attribute named delivery_date, enter delivery_date as the key and the date you want to match as the value.

Both conditions offer is, is not, contains, does not contain, and starts with. Cart attribute also offers is one of and is not one of. Enter one value per line for those list comparisons. Matching ignores letter case and surrounding spaces.

The key is required. Each rule can check only one cart attribute key and one cart items attribute key, even across multiple condition groups. You can use different comparisons for the same key in one rule.

Example: check a delivery date

If your store adds a cart attribute called delivery_date, you could set Cart attribute is a date when orders cannot be delivered, then write an error that asks the customer to choose another date. A missing attribute does not match any comparison, including is not. This means BlockCart can't stop an order because an attribute is missing, such as when a customer skips a delivery date picker. It can only check the value when the attribute is there.

For conditions that must match together, see Combine conditions with AND and OR groups. For the full rule setup, see Create your first checkout rule.

Related articles