Cart template
Cart lines, quantity updates, removal, totals and notices.
Output: page body inside the storefront layout.
Shared structures available in recorded contexts: shop, branding, theme, urls, page, navigation, languageSwitcher, currencySwitcher, headerActionContributions, labels, security, footer, cartPreview, accountHeader.
| Field | Type | Meaning | Availability |
|---|---|---|---|
viewModel.cart |
object | Cart data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.cart.amountType |
string | Amount type value supplied for this context. | When the parent is provided; check optional fields. |
viewModel.cart.cartId |
number | cart identifier; do not load data with it. | When the parent is provided; check optional fields. |
viewModel.cart.cartKey |
string | Cart key value supplied for this context. | When the parent is provided; check optional fields. |
viewModel.cart.checkoutBlocked |
boolean | Whether checkout blocked applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.cart.currencyIsoCode |
string | Currency iso code value supplied for this context. | When the parent is provided; check optional fields. |
viewModel.cart.display |
object | Display data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels |
object | Labels data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.availabilityLimited |
string | Translated availability limited text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.availabilityUnavailable |
string | Translated availability unavailable text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.checkout |
string | Translated checkout text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.checkoutBlocked |
string | Translated checkout blocked text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.continueShopping |
string | Translated continue shopping text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.empty |
string | Translated empty text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.notReservedNotice |
string | Translated not reserved notice text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.pickupOnlyBadge |
string | Translated pickup only badge text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.pickupOnlyNotice |
string | Translated pickup only notice text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.price |
string | Translated price text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.pricingGap |
string | Translated pricing gap text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.product |
string | Translated product text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.quantity |
string | Translated quantity text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.removeItem |
string | Translated remove item text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.shippingTaxNote |
string | Translated shipping tax note text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.subtotal |
string | Translated subtotal text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.title |
string | Translated title text. | When the parent is provided; check optional fields. |
viewModel.cart.display.labels.total |
string | Translated total text. | When the parent is provided; check optional fields. |
viewModel.cart.fulfillment |
object | Fulfillment data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.cart.fulfillment.hasPickupOnlyItems |
boolean | Whether pickup only items applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.cart.hasAvailabilityIssues |
boolean | Whether availability issues applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.cart.hasNotReservedNotice |
boolean | Whether not reserved notice applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.cart.hasPickupOnlyItems |
boolean | Whether pickup only items applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.cart.hasPricingGaps |
boolean | Whether pricing gaps applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.cart.isEmpty |
boolean | Whether empty applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.cart.itemCount |
number | Item count numeric value. | When the parent is provided; check optional fields. |
viewModel.cart.items |
array | Prepared items collection; may be empty. | When the parent is provided; check optional fields. |
viewModel.cart.items[].amountType |
string | Amount type value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability |
object | Availability data; check child fields before use. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.alwaysAvailable |
boolean | Whether always available applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.availableQuantity |
number | Available quantity numeric value. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.backorderAllowed |
boolean | Whether backorder allowed applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.canFulfillRequestedQuantity |
boolean | Whether fulfill requested quantity applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.hasInventoryItem |
boolean | Whether inventory item applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.isOrderable |
boolean | Whether orderable applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.maxOrderQuantity |
number | Max order quantity numeric value. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.quantityOnHand |
number | Quantity on hand numeric value. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.requestedQuantity |
number | Requested quantity numeric value. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.reservedQuantity |
number | Reserved quantity numeric value. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availability.status |
string | Status value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availabilityChecked |
boolean | Whether availability checked applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availabilityIssueType |
string | Availability issue type value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].availabilityMessage |
string | Availability message value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].canCheckout |
boolean | Whether checkout applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].cartItemId |
number | cart item identifier; do not load data with it. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].configurationDisplayGroups |
array | Prepared configuration display groups collection; may be empty. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].displayName |
string | Display name value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].fulfillmentMode |
string | Fulfillment mode value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].hasavailabilitymessage |
boolean | Whether hasavailabilitymessage applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].hasPersonalizationSurcharge |
boolean | Whether personalization surcharge applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].hasPrice |
boolean | Whether price applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].hasProductUrl |
boolean | Prepared has product URL; use unchanged. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].hasVariant |
boolean | Whether variant applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].imageMediaAssetId |
number | image media asset identifier; do not load data with it. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].imageUrl |
string | Prepared image URL; use unchanged. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].isPickupOnly |
boolean | Whether pickup only applies; use for display only. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].lineTotalAmount |
number | line total amount; use the corresponding prepared label for display. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].lineTotalLabel |
string | Prepared line total display text. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].maxOrderQuantity |
number | Max order quantity numeric value. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].minimumOrderQuantity |
number | Minimum order quantity numeric value. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].name |
string | Name value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].personalizationSurchargeAmount |
number | personalization surcharge amount; use the corresponding prepared label for display. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].personalizationSurchargeLabel |
string | Prepared personalization surcharge display text. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].productId |
number | product identifier; do not load data with it. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].productUrl |
string | Prepared product URL; use unchanged. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].productVariantId |
number | product variant identifier; do not load data with it. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].quantity |
number | Quantity numeric value. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].sku |
string | Sku value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].unitPriceBaseLabel |
string | Prepared unit price base display text. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].unitPriceLabel |
string | Prepared unit price display text. | For each existing item; optional child fields depend on item type. |
viewModel.cart.items[].variantName |
string | Variant name value supplied for this context. | For each existing item; optional child fields depend on item type. |
viewModel.cart.quantityTotal |
number | Quantity total numeric value. | When the parent is provided; check optional fields. |
viewModel.cart.subtotalAmount |
number | subtotal amount; use the corresponding prepared label for display. | When the parent is provided; check optional fields. |
viewModel.cart.subtotalLabel |
string | Prepared subtotal display text. | When the parent is provided; check optional fields. |
viewModel.hasNotice |
boolean | Whether notice applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.notice |
object | Notice data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.notice.message |
string | Message value supplied for this context. | When the parent is provided; check optional fields. |
viewModel.notice.type |
string | Type value supplied for this context. | When the parent is provided; check optional fields. |
viewModel.search |
object | Search data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.search.isEnabled |
boolean | Whether enabled applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.wishlist |
object | Wishlist data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.wishlist.isEmpty |
boolean | Whether empty applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.wishlist.itemCount |
number | Item count numeric value. | When the parent is provided; check optional fields. |
viewModel.wishlist.items |
array | Prepared items collection; may be empty. | When the parent is provided; check optional fields. |
viewModel.wishlist.productIdMap |
object | Product id map data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.wishlist.productIds |
array | Prepared product ids collection; may be empty. | When the parent is provided; check optional fields. |
viewModel.wishlist.wishlistId |
number | wishlist identifier; do not load data with it. | When the parent is provided; check optional fields. |
viewModel.wishlist.wishlistKey |
string | Wishlist key value supplied for this context. | When the parent is provided; check optional fields. |
Assets
Section titled “Assets”The reference package uses its bundled theme CSS, Bootstrap and theme JavaScript. Account and checkout controls use the bundled checkout script. Partials use their caller’s resolved assets.
Example
Section titled “Example”<cfset viewModel = routeConfig.viewModel><cfoutput><h1>#encodeForHtml(viewModel.page.title)#</h1></cfoutput>Use the page-specific structures above for the remaining content.
Behaviour
Section titled “Behaviour”Use prepared URLs and labels. Encode plain text and HTML attributes; preserve only explicitly prepared HTML.