A customer’s cart.
Properties
- attributesattributes
Additional attributes entered by the customer with the cart.
To learn more about capturing cart attributes, refer to the
carttemplate.- cart_level_discount_applicationscart_level_discount_applicationsarray of discount_application
The cart-specific discount applications for the cart.
The amount that the customer will be charged at checkout in the currency's subunit.
The value is output in the customer's local (presentment) currency.
For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.
TipUse money filters to output a formatted price.
Tip:Use money filters to output a formatted price.
Tip: Use <a href="/docs/api/liquid/filters/money-filters">money filters</a> to output a formatted price.
- currencycurrency
The currency of the cart.
If the store uses multi-currency, then this is the same as the customer's local (presentment) currency. Otherwise, it's the same as the store currency.
TipYou can output the store's available currencies using
shop.enabled_currencies.Tip:You can output the store's available currencies using
shop.enabled_currencies.Tip: You can output the store's available currencies using <a href="/docs/api/liquid/objects/shop#shop-enabled_currencies"><code><span class="PreventFireFoxApplyingGapToWBR">shop.enabled<wbr/>_currencies</span></code></a>.
- discount_applicationsdiscount_applicationsarray of discount_application
The discount applications for the cart.
Returns
trueif duties are included in the prices of products in the cart. Returnsfalseif not.Returns
trueif there are no items in the cart. Return'sfalseif there are.The total price of all of the items in the cart in the currency's subunit, after any line item discounts. This doesn't include taxes (unless taxes are included in the prices), cart discounts, or shipping costs.
The value is output in the customer's local (presentment) currency.
For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.
TipUse money filters to output a formatted amount.
Tip:Use money filters to output a formatted amount.
Tip: Use <a href="/docs/api/liquid/filters/money-filters">money filters</a> to output a formatted amount.
Additional information captured with the cart.
To learn more about capturing cart notes, refer to the
carttemplate.The total price of all of the items in the cart in the currency's subunit, before discounts have been applied.
The value is output in the customer's local (presentment) currency.
For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.
TipUse money filters to output a formatted amount.
Tip:Use money filters to output a formatted amount.
Tip: Use <a href="/docs/api/liquid/filters/money-filters">money filters</a> to output a formatted amount.
Returns
trueif any of the products in the cart require shipping. Returnsfalseif not.Returns
trueif taxes are included in the prices of products in the cart. Returnsfalseif not.This can be set in a store’s tax settings.
If the store includes or exclude tax based on the customer’s country, then the value reflects the tax requirements of the customer’s country.
The total amount of all discounts (the amount saved) for the cart in the currency's subunit.
The value is output in the customer's local (presentment) currency.
For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.
TipUse money filters to output a formatted amount.
Tip:Use money filters to output a formatted amount.
Tip: Use <a href="/docs/api/liquid/filters/money-filters">money filters</a> to output a formatted amount.
The total price of all of the items in the cart in the currency's subunit, after discounts have been applied.
The value is output in the customer's local (presentment) currency.
For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.
TipUse money filters to output a formatted amount.
Tip:Use money filters to output a formatted amount.
Tip: Use <a href="/docs/api/liquid/filters/money-filters">money filters</a> to output a formatted amount.
The total weight of all of the items in the cart in grams.
TipUse the
weight_with_unitfilter to format the weight in the store's format, or override the default unit.Tip:Use the
weight_with_unitfilter to format the weight in the store's format, or override the default unit.Tip: Use the <a href="/docs/api/liquid/filters/weight_with_unit"><code><span class="PreventFireFoxApplyingGapToWBR">weight<wbr/>_with<wbr/>_unit</span></code></a> filter to format the weight in <a href="https://www.shopify.com/admin/settings/general">the store's format</a>, or override the default unit.
Deprecated Properties
The discounts applied to the cart.
DeprecatedDeprecated because not all discount types and details are available.
The
cart.discountsproperty has been replaced bycart.discount_applications.Deprecated:Deprecated because not all discount types and details are available.
The
cart.discountsproperty has been replaced bycart.discount_applications.
Example
{
"attributes": {},
"cart_level_discount_applications": [],
"checkout_charge_amount": "380.25",
"currency": {},
"discount_applications": [],
"discounts": [],
"duties_included": false,
"empty?": false,
"item_count": 2,
"items": [],
"items_subtotal_price": "422.49",
"note": "Hello this is a note",
"original_total_price": "424.99",
"requires_shipping": true,
"taxes_included": false,
"total_discount": "44.74",
"total_price": "380.25",
"total_weight": 0
}