CartSella marks the cart with ordinary Shopify line item properties and cart note attributes. Everything on this page is visible in /cart.js, in Liquid via item.properties and cart.attributes, and on the order in the Shopify admin.
All property names begin with an underscore. Shopify treats underscore-prefixed line item properties as private: they are not shown to the shopper in checkout, and themes conventionally skip them in the line item property loop.

Line item properties

Read these freely. Do not write, rename or strip them. See the rules.

The _cs value format

_cs collapses what used to be three separate properties into one value.
  • entity id is the offer, upsell or campaign link id.
  • entity type is offer, upsell or campaign_link.
  • entity subtype is the specific kind, for example gift_with_purchase, fixed_bundle, cart_drawer_cross_sell, campaign_link_checkout.
One line can belong to several entities at once, for example a cart drawer upsell product that also happens to trigger a gift with purchase. Those are joined with a pipe:
When _cs is missing, fall back to the parallel legacy lists _cartsella_id, _cartsella_type and _cartsella_subtype, which are comma-separated and paired by position. See parsing recipes for both.

_cs_role

_cs_role is the fastest test in the cart. reward means the line is free or discounted merchandise CartSella put there. item means it is a normal paid line that CartSella tagged.
A reward line never counts as a trigger for another offer and never counts toward a spend threshold. An item line can trigger as many offers as it matches.

Cart note attributes

_cs_attr is written as the two-character string "[]" when there is nothing to attribute, never as "". Shopify deletes a note attribute whose value is an empty string, so an empty write would be undone and rewritten on every single cart mutation. If you ever mirror or rewrite cart attributes, preserve "[]" verbatim.

_cs_attr keys

The array holds one object per attributed entity. Keys are shortened to keep the merchant’s order “Additional details” panel readable. Both spellings are read forever, so a parser should accept t or entity_type, i or entity_id, and so on.

Reading everything off one line

In Liquid, use bracket access (item.properties['_cs']) rather than dot access for names that start with an underscore. Bracket access is unambiguous across Liquid implementations and reads better next to the legacy fallbacks.

Next

Gift with purchase walks through the one case most themes need: telling a gift line from a trigger line, and rendering it differently.