The cart object
cart object has the following attributes:
cart.attributes allow the capturing of more information on the cart page. This is done by giving an input a
nameattribute with the following syntax:
Shown below is a basic example of how to use an HTML input of type "text" to capture information on the cart page.
cart.attributes can be accessed in order email templates, the order status page of the checkout, as well as in apps such as Order Printer.
For more examples on how to use cart attributes, see Ask a customer for additional information.
Returns an array of any cart-specific discount applications for the cart.
Returns the currency of the cart. If your store uses multi-currency, then the
cart.currency is the same as the customer's local (presentment) currency. Otherwise, the cart currency is the same as your store currency.
To return the list of currencies that are accepted by your store, see the shop.enabled_currencies object.
Returns an array of discount applications for the cart.
Returns the number of items inside the cart.
Returns all of the line items in the cart.
Returns the sum of the cart's line-item prices after any line-item discount. The subtotal doesn't include taxes (unless taxes are included in the prices), cart discounts, or shipping costs.
cart.note allows the capturing of more information on the cart page.
This is done by submitting the cart form with an HTML
textarea and wrapping the
cart.note can be accessed in order email templates, the order status page of the checkout, as well as in apps such as Order Printer. For examples on how to use cart notes, see Ask a customer for additional information.
Returns the subtotal of the cart before any discounts have been applied.
Returns the total of all discounts (the amount saved) for the cart.
Returns the total price of all of the items in the cart after discounts have been applied.
Returns the total weight of all of the items in the cart.