Next Commerce
Cart SummaryReference

Object Attributes

SummaryLine

One entry in the cart summary line items list (data-summary-lines). Corresponds to one package in the cart.

Pricing fields come from the API calculate endpoint. Display fields (name, image, etc.) come from campaign data enriched by the cart store. Fields marked campaign data render as empty strings when campaign data is unavailable.

item.* tokens — canonical (use these)

TokenTypeNullableDescription
{item.packageId}stringnoPackage ref_id. Integer as a string.
{item.name}stringyes*Package display name. campaign data
{item.image}stringyes*Product image URL. campaign data
{item.quantity}stringnoQuantity in cart. Integer as a string.
{item.productName}stringyes*Product name. campaign data
{item.variantName}stringyes*Variant name, if applicable. campaign data
{item.sku}stringyes*Product SKU. campaign data
{item.isRecurring}"true" | "false"noWhether this is a recurring/subscription line.
{item.interval}stringyesBilling interval: "day", "month", or empty string for one-time.
{item.intervalCount}stringyesNumber of intervals per billing cycle (e.g. "3"). Empty string for one-time.
{item.frequency}stringyesHuman-readable billing frequency (e.g. "Monthly", "Every 3 months", "Daily").
{item.recurringPrice}stringyes*Recurring unit price (subscriptions). Formatted. campaign data
{item.originalRecurringPrice}stringyes*Original recurring price before any discount. Formatted. campaign data
{item.price}stringnoLine total after discounts — quantity × unitPrice (API line.total). Formatted.
{item.originalPrice}stringnoLine subtotal before discounts — quantity × originalUnitPrice (API line.subtotal). Formatted.
{item.unitPrice}stringnoPer-unit price after discounts (API). Formatted.
{item.originalUnitPrice}stringnoPer-unit price before discounts (API). Formatted.
{item.discountAmount}stringnoTotal discount applied to this line. Formatted.
{item.discountPercentage}stringnoDiscount as a percentage of the original unit price, formatted with % (e.g. "20%"). "0%" when no discount.
{item.hasDiscount}"show" | "hide"no"show" when discountAmount > 0. Use as a CSS class or visibility flag.
{item.currency}stringyesActive currency code for this line (e.g. "USD").

line.* tokens — alias

line.* is a 1:1 alias of item.*

Every {item.X} token above is also reachable as {line.X}. The two namespaces are 1:1 equivalents — pick whichever vocabulary fits your template:

  • item — the cart-shopper mental model (the same field names used elsewhere when rendering cart items).
  • line — the invoice / order-row mental model (matches the API field summary.lines).

Don't mix them in the same template; pick one for consistency.

Pre-v0.4.11 names that no longer exist

The following pre-v0.4.11 token names were removed when the namespace was reorganized in v0.4.11. They render as empty strings — migrate to the current names.

Pre-v0.4.11 tokenCurrent token
{line.qty}{item.quantity} / {line.quantity}
{line.priceTotal} / {line.total}{item.price} / {line.price} (now the line total — {line.price} was per-unit pre-v0.4.11)
{line.subtotal}{item.originalPrice} / {line.originalPrice}
{line.priceRetail}{item.originalUnitPrice} / {line.originalUnitPrice}
{line.priceRetailTotal}{item.originalPrice} / {line.originalPrice}
{line.priceRecurring} / {line.priceRecurringTotal}{item.recurringPrice} / {line.recurringPrice}
{line.totalDiscount}{item.discountAmount} / {line.discountAmount}
{line.packagePrice} / {line.originalPackagePrice}no direct equivalent — use {item.unitPrice} for per-unit prices
{line.hasSavings}derive from {item.hasDiscount} / {line.hasDiscount}

Discount

One discount entry in an offer, voucher, or per-line discount list.

TokenTypeNullableDescription
{discount.name}stringyesDisplay name of the discount (e.g., "Bundle deal", "SAVE20"). Empty string when absent.
{discount.amount}stringnoFormatted discount amount (e.g., "$10.00").
{discount.description}stringyesHuman-readable description of the discount. Empty string when absent.

ItemContext (per-line condition shape)

The raw-typed object exposed to data-next-show / data-next-hide conditions inside data-summary-lines and data-line-discounts row templates. Distinct from the {item.*} text tokens above — values here are unformatted (real numbers, real booleans) so comparison operators behave as expected.

Conditions can use line.X interchangeably with item.X (e.g. data-next-show="line.quantity > 1" works identically to data-next-show="item.quantity > 1"). The line namespace is a 1:1 alias of item — see the line.* tokens — alias section above.

FieldTypeNullableDescription
item.packageIdnumbernoPackage ref_id
item.namestringnoPackage display name (empty string when absent)
item.imagestringnoProduct image URL (empty string when absent)
item.quantitynumbernoUnit quantity for this line
item.productNamestringnoProduct name (empty string when absent)
item.variantNamestringnoVariant name (empty string when no variant)
item.skustringnoProduct SKU (empty string when absent)
item.isRecurringbooleannotrue when the line is a subscription
item.interval'day' | 'month' | nullyesSubscription interval. null for one-time purchases.
item.intervalCountnumber | nullyesSubscription interval count. null for one-time purchases.
item.recurringPricenumber | nullyesRecurring unit price as a raw number. null when not set.
item.originalRecurringPricenumber | nullyesOriginal recurring price as a raw number. null when not set.
item.pricenumbernoLine total after discounts (line.total) as a raw number
item.originalPricenumbernoLine subtotal before discounts (line.subtotal) as a raw number
item.unitPricenumbernoPer-unit price after discounts as a raw number
item.originalUnitPricenumbernoPer-unit price before discounts as a raw number
item.discountAmountnumbernoTotal discount on this line as a raw number
item.discountPercentagenumbernoDiscount as an integer percentage of the original unit price (e.g. 25 for 25%). 0 when no discount.
item.hasDiscountbooleannotrue when discountAmount > 0
item.currencystringnoActive currency code (empty string when absent)
item.frequencystringnoHuman-readable billing frequency ("Monthly", "Every 3 months", etc.). Empty string for one-time purchases.

Raw values vs text tokens

The item.* paths in this table are the raw values exposed to conditions. The same paths used as {item.*} text tokens still render as currency-formatted strings or "show" / "hide" for backwards compatibility — see the SummaryLine table above.


DiscountContext (per-discount condition shape)

The raw-typed object exposed to data-next-show / data-next-hide conditions inside data-summary-offer-discounts, data-summary-voucher-discounts, and data-line-discounts row templates.

FieldTypeNullableDescription
discount.namestringnoDisplay name of the discount (empty string when absent)
discount.amountnumbernoDiscount amount as a raw number with currency formatting stripped. 0 when unparseable.
discount.amountFormattedstringnoOriginal currency-formatted amount string (matches the {discount.amount} text token)
discount.descriptionstringnoDescription of the discount (empty string when absent)

On this page