Overview
Thecart-summary snippet renders the cart totals section, including subtotal, discounts, estimated total, cart notes, discount code input, and checkout buttons.
File Location: snippets/cart-summary.liquid
Parameters
string
Layout for additional checkout buttons (e.g., Apple Pay, Google Pay).Options:
'vertical' | 'horizontal'Default: Determined by Shopify platformstring
The section ID for the cart discount component. Used for proper morphing updates.
Usage
Basic Example
With Parameters
In Cart Block
_cart-summary.liquid (block)
Features
Cart Totals Display
The snippet displays cart totals with support for discounts:Currency Display
Currency codes can be shown based on settings:cart-summary.liquid
Cart Note
Optional cart note field with accordion UI:cart-summary.liquid
settings.show_cart_note- Enable/disable cart notesettings.cart_note_open_by_default- Whether accordion starts open
Discount Code Input
Discount code application with error handling:cart-summary.liquid
Applied Discount Pills
Shows currently applied discount codes with remove option:cart-summary.liquid
Payment Installments
Optional payment terms display:cart-summary.liquid
Tax Information
Shows tax and shipping information:cart-summary.liquid
Checkout Buttons
Primary checkout button with support for additional payment methods:Theme Settings
The snippet behavior is controlled by several theme settings:boolean
Enable the cart note textarea
boolean
Whether cart note accordion starts expanded
boolean
Enable discount code input field
boolean
Display payment installment options (e.g., “4 interest-free payments”)
boolean
Show additional checkout buttons (Apple Pay, Google Pay, etc.)
boolean
Show currency codes (e.g., “USD”) in cart total
Styling
The snippet includes comprehensive scoped styles:Layout Structure
Cart Actions (Notes & Discounts)
Typography
Data Attributes
Key data attributes for JavaScript interaction:attribute
Cart subtotal value for testing
attribute
Cart total value for testing
attribute
Used by payment terms web component
attribute
Section ID for cart discount component
attribute
Discount code value on pill elements
Examples
Accessibility
The snippet includes several accessibility features:- Role Attributes:
role="list"on discount lists,role="status"on totals - ARIA Labels: Descriptive labels for form inputs and buttons
- Visual Hidden Text: Screen reader context for prices
- Focus Management: Keyboard navigation support in accordions
Related Snippets
cart-products.liquid- Cart line items displaytax-info.liquid- Tax and shipping information- Add to Cart Button - Product add to cart functionality