Skip to main content

Cart variables

Written by Shashank Agrawal

Cart variables are available when the campaign is triggered in the context of the customer's shopping cart — for example, on the cart page, in a cart drawer, or via a cart-abandonment trigger. They reflect the live state of the cart at the moment the campaign is shown.

All amount variables have a _wo_currency counterpart that returns the raw number without formatting.

  • cart.productCount — The total number of distinct products currently in the cart. Does not count individual units — a cart with 3 units of the same product counts as 1.

  • cart.amount — The current cart total, formatted with the store's currency. This is the amount the customer would pay after any applied discounts.

  • cart.amount_wo_currency — The cart total as a raw number.

  • cart.originalAmount — The cart total before any discounts are applied, formatted with currency. Showing this alongside cart.amount lets you highlight the saving.

  • cart.originalAmount_wo_currency — The pre-discount cart total as a raw number.

  • cart.total_line_items_discount — The total discount applied at the line item level (i.e. from automatic discounts on individual products), formatted with currency.

  • cart.total_line_items_discount_wo_currency — Line item discounts as a raw number.

  • cart.total_discount — The total discount applied across the entire cart from all sources, formatted with currency.

  • cart.total_discount_wo_currency — Total cart discount as a raw number.

  • cart.total_savings — The total savings figure displayed in the savings progress bar, formatted with currency.

  • cart.total_savings_wo_currency — Total savings as a raw number.

Did this answer your question?