Skip to content

Apply checkout and line item attributes

Two blocks add data to the order without showing anything to the customer. Use them with display rules to record that something happened, or to pass a condition to a function that can’t check it directly.

Block Adds Plan
Apply checkout attribute One checkout attribute on the order Business
Apply line item attribute An attribute (line item property) on matching items Business

Both need Shopify Plus and must be placed in the Checkout Editor, each in its own app block with a Fixed block ID. See which block shows.

Setting What it does
Attribute key The attribute’s name, such as pickup-selected.
Attribute value The value, such as yes. Plain text.
Clear attribute value when hidden When the block’s display rules stop passing, set the value back to empty. Off by default.

The attribute is added when the block shows, that is, when its display rules pass. It appears on the order under Additional details.

Let a function react to something only a block can see

Section titled “Let a function react to something only a block can see”

Functions can only check some parts of checkout. Blocks can check more, such as the selected payment type, a form answer, or whether an order note exists. This block bridges the two:

  1. Create an Apply checkout attribute block with the condition as its display rules, for example Selected payment option type includes Manual Payment, and key manual-payment, value yes. Tick Clear attribute value when hidden.
  2. In the function, add the rule Cart attribute key, value with the same key and value.

See the full recipe, including which functions support cart attribute rules.

Setting What it does
Select products/variants to apply attribute to The items to tag. Matching is by variant.
Line item attribute key The attribute’s name. Start it with an underscore, such as _bundle, to hide it from customers in most themes.
Line item attribute value The value.
Clear attribute value when hidden Remove the attribute when the block’s rules stop passing. On by default.

When the block shows, it adds the attribute to every matching item in the cart. Placed under each item in the order summary, it only tags the item it sits under, which lets you combine it with Target line item rules.

Line item attributes show on the order next to each item. Discount functions can read them with the Line attribute key and Line attribute key, value rules, so you can discount only tagged items.

  • Items that already have the key are left alone, even if the value is different.
  • Add this block with the main Checkout Buddy app block. The Checkout Buddy - Cart Line Item app block doesn’t run it.
  • Attributes are only added once the customer reaches the page where the block is placed. Express checkouts that skip that page won’t have them.
  • Disable custom attributes on the app block doesn’t affect these blocks. It only stops Checkout Buddy’s own analytics data.