Skip to main content
This page covers cart usage: cartItems, item properties, and data attributes for quantity and remove. For checkout-only topics (totals, form fields, coupon, payment), see Checkout.

Scope: cartItems / items

cartItems (or items) is an array of line items. The cart plugin fills it; UI updates are reactive when cart scope changes.
price and total are already formatted. Use [[ item.price ]] and [[ item.total ]] as-is. See Functions for when to use formatPrice.bonuses, courses, is_subscription, and subscription are populated after a brief async fetch from the server when the cart loads. They are always present (empty array / false / null) so templates never error.

Subscription details (item.subscription)

When item.is_subscription is true, item.subscription contains billing cadence and trial settings: Example — showing billing cadence next to the price:
The same is_subscription and subscription fields are available on checkout scope for single-product checkout pages (e.g. [[ checkout.is_subscription ]], [[ checkout.subscription.frequency ]]).

Bonus products (item.bonuses)

Each cart item may include a bonuses array — products that are included free with that item (configured in the product catalog under Bonuses). Populated automatically from the /api/cart-products response after the cart loads. Each element in item.bonuses has: Example:
item.bonuses is always an array — empty when the product has no bonuses configured.

Courses (item.courses)

When a product has linked courses, they are available as item.courses. Populated automatically from the /api/cart-products response after the cart loads. Each element in item.courses has: Example — listing included courses beneath a cart line:
item.courses is always an array — empty when the product has no linked courses.

Quantity and remove (data attributes)

Use these so the cart plugin handles +/- and remove without custom script: Example:
You can wrap the Remove button in <template-if data-condition="cartItems.length > 1"> so it only shows when there is more than one item (use &gt; for > in data-condition). For custom behavior, use @click with window.ef.addToCart(code, options?, quantity?), window.ef.setCartQuantity(code, quantity), or window.ef.removeFromCart(code, allowClear?) if the app exposes window.ef.

Order bumps (on checkout)

On checkout pages, bump cards use these data attributes so the bump-products plugin can toggle and style: For scope (checkout.bump_products, checkout.selectedBumpLines) and full offer vs added template pattern, see Checkout — Order bumps.

Summary

  • Use cartItems and [[ item.* ]]; item.price and item.total are already formatted.
  • item.is_subscription / item.subscription — billing cadence; also on checkout scope for single-product pages.
  • item.bonuses — free bonus products linked to the item; always an array.
  • item.courses — courses linked to the product; always an array.
  • Use data-cart-qty-minus/plus/remove and data-code for qty and remove.
  • Bumps: use data-bump-* attributes; scope and patterns are in Checkout.