Line-item properties
Definition
Line-item properties are key and value pairs attached to a cart line at the moment it's added. They travel with that line through checkout and onto the order, and keys beginning with an underscore stay on the record while staying hidden from the shopper. They are the only place a theme can put per-line data that Shopify has no field for.
Documented at shopify.dev, the line item object.
How We've Used It
Every customer-composed thing we build ends up here. A palette a shopper fills, a kit with a shade chosen per component, a bundle whose contents have to reach the warehouse: the cart line is one SKU and the picks ride along beside it. We write them twice on purpose, once as readable keys the shopper sees in the cart and at checkout, and once as underscore-prefixed keys carrying variant ids and a bundle id so the same bundle can be re-read and edited in place. What properties can't do is change a price, which is a Function's job, so a bundle built this way is a fixed-price bundle by design.
Builds Using It
- Cart page rebuilt around loyalty points, protected gifts and a dark order summary — Nudestix
- Tabbed collection product slider and the shared merchandising card — Three Ships
One further gated build uses it; its page follows.
Related Entities
- Cart AJAX API — the request that carries them.
- localStorage — where an unfinished selection waits.
- Fixed bundles and kit merchandising — the capability they carry.