---
title: Cart Items Methods
excerpt: Manage line items, quantities, and discounts programmatically
deprecated: false
hidden: false
metadata:
title: ''
description: ''
robots: index
next:
description: Return to the New Methods Overview Page to see other available methods.
pages:
- type: endpoint
slug: smart-cart-methods
title: Methods Overview - New
---
<dl>
<dt><a href="#SmartCart.automaticDiscountTotalAmountSaved">SmartCart.automaticDiscountTotalAmountSaved</a> ⇒ <code>number</code></dt>
<dd>
<p>Returns the total amount saved from automatic discounts on items in the cart</p>
</dd>
<dt><a href="#SmartCart.compareAtPrice">SmartCart.compareAtPrice</a> ⇒ <code>number</code> | <code>null</code></dt>
<dd>
<p>Gets the compare at price for a cart item</p>
</dd>
<dt><a href="#SmartCart.decreaseItem">SmartCart.decreaseItem</a></dt>
<dd>
<p>Decreases the quantity of a cart item</p>
</dd>
<dt><a href="#SmartCart.hasAutomaticDiscountApplied">SmartCart.hasAutomaticDiscountApplied</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determines whether any of the items in the cart have an automatic discount applied</p>
</dd>
<dt><a href="#SmartCart.hasItemProperties">SmartCart.hasItemProperties</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determines if the cart item has any content it should render in the line item properties area in the Smart Cart</p>
</dd>
<dt><a href="#SmartCart.hasItems">SmartCart.hasItems</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determines whether the cart has items</p>
</dd>
<dt><a href="#SmartCart.hasLineItemDiscount">SmartCart.hasLineItemDiscount</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determines whether the cart item has a line item discount</p>
</dd>
<dt><a href="#SmartCart.hiddenItems">SmartCart.hiddenItems</a> ⇒ <code>Array.<object></code></dt>
<dd>
<p>Returns the hidden items in the cart</p>
</dd>
<dt><a href="#SmartCart.hideQuantitySelectors">SmartCart.hideQuantitySelectors</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determines whether the quantity selectors should be hidden for the cart item
based on product tags or properties</p>
</dd>
<dt><a href="#SmartCart.increaseItem">SmartCart.increaseItem</a></dt>
<dd>
<p>Increases the quantity of a cart item</p>
</dd>
<dt><a href="#SmartCart.isHiddenItem">SmartCart.isHiddenItem</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determines whether the cart item should be hidden in the Smart Cart based on product tags or properties</p>
</dd>
<dt><a href="#SmartCart.itemCount">SmartCart.itemCount</a> ⇒ <code>number</code></dt>
<dd>
<p>Returns the total number of items in the cart (excluding hidden items)</p>
</dd>
<dt><a href="#SmartCart.itemHasDiscount">SmartCart.itemHasDiscount</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determines whether the cart item has a discount</p>
</dd>
<dt><a href="#SmartCart.itemPrice">SmartCart.itemPrice</a> ⇒ <code>number</code></dt>
<dd>
<p>Gets the price for a cart item</p>
</dd>
<dt><a href="#SmartCart.itemProductTagsClasses">SmartCart.itemProductTagsClasses</a> ⇒ <code>string</code></dt>
<dd>
<p>Gets a string of tag-based classes for the line item</p>
</dd>
<dt><a href="#SmartCart.itemProperties">SmartCart.itemProperties</a> ⇒ <code>Array.<object></code></dt>
<dd>
<p>Gets the line item properties to display in the cart</p>
</dd>
<dt><a href="#SmartCart.itemPropertyClasses">SmartCart.itemPropertyClasses</a> ⇒ <code>string</code></dt>
<dd>
<p>Gets a string of multiple property-based classes for the line item</p>
</dd>
<dt><a href="#SmartCart.itemPropertyKeyClass">SmartCart.itemPropertyKeyClass</a> ⇒ <code>string</code></dt>
<dd>
<p>Gets a single CSS class for the line item property key</p>
</dd>
<dt><a href="#SmartCart.itemPropertyValueClass">SmartCart.itemPropertyValueClass</a> ⇒ <code>string</code></dt>
<dd>
<p>Gets a single CSS class for the line item property value</p>
</dd>
<dt><a href="#SmartCart.itemURL">SmartCart.itemURL</a> ⇒ <code>string</code></dt>
<dd>
<p>Gets the URL for a cart item</p>
</dd>
<dt><a href="#SmartCart.items">SmartCart.items</a> ⇒ <code>Array.<object></code></dt>
<dd>
<p>Returns the items in the cart</p>
</dd>
<dt><a href="#SmartCart.itemsWithSubtotalExclusions">SmartCart.itemsWithSubtotalExclusions</a> ⇒ <code>Array.<object></code></dt>
<dd>
<p>Gets the cart items with or without subtotal exclusions</p>
</dd>
<dt><a href="#SmartCart.lineItemDiscountMessage">SmartCart.lineItemDiscountMessage</a> ⇒ <code>string</code> | <code>null</code></dt>
<dd>
<p>Gets the discount message for a line item</p>
</dd>
<dt><a href="#SmartCart.removeItem">SmartCart.removeItem</a></dt>
<dd>
<p>Removes an item from the cart</p>
</dd>
</dl>
<a name="SmartCart.automaticDiscountTotalAmountSaved"></a>
## `SmartCart.automaticDiscountTotalAmountSaved` ⇒ <code>number</code>
Returns the total amount saved from automatic discounts on items in the cart
**Returns**: <code>number</code> - the total amount saved from automatic discounts on items in the cart\
(excludes items with subtotal exclusions)\ <a name="SmartCart.compareAtPrice"></a>
## `SmartCart.compareAtPrice` ⇒ <code>number</code> \| <code>null</code>
Gets the compare at price for a cart item
**Returns**: <code>number</code> \| <code>null</code> - The compare at price of the cart item or null if not applicable
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.decreaseItem"></a>
## `SmartCart.decreaseItem`
Decreases the quantity of a cart item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
<tr>
<td>
callback
</td>
<td>
<code>function</code>
</td>
<td>
Function to call after decreasing the item quantity
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.hasAutomaticDiscountApplied"></a>
## `SmartCart.hasAutomaticDiscountApplied` ⇒ <code>boolean</code>
Determines whether any of the items in the cart have an automatic discount applied
**Returns**: <code>boolean</code> - Boolean indicating whether any of the items in the cart have an automatic discount applied\ <a name="SmartCart.hasItemProperties"></a>
## `SmartCart.hasItemProperties` ⇒ <code>boolean</code>
Determines if the cart item has any content it should render in the line item properties area in the Smart Cart
**Returns**: <code>boolean</code> - Whether the cart item has any properties to render (or a delivery frequency with Switch to Subscription disabled)
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item object to check for properties
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.hasItems"></a>
## `SmartCart.hasItems` ⇒ <code>boolean</code>
Determines whether the cart has items
**Returns**: <code>boolean</code> - Boolean indicating whether the cart has items\ <a name="SmartCart.hasLineItemDiscount"></a>
## `SmartCart.hasLineItemDiscount` ⇒ <code>boolean</code>
Determines whether the cart item has a line item discount
**Returns**: <code>boolean</code> - Boolean indicating whether the cart item has a line item discount
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.hiddenItems"></a>
## `SmartCart.hiddenItems` ⇒ <code>Array.\<object></code>
Returns the hidden items in the cart
**Returns**: <code>Array.\<object></code> - Array of hidden items in the cart\ <a name="SmartCart.hideQuantitySelectors"></a>
## `SmartCart.hideQuantitySelectors` ⇒ <code>boolean</code>
Determines whether the quantity selectors should be hidden for the cart item\
based on product tags or properties
**Returns**: <code>boolean</code> - Boolean indicating whether the quantity selectors should be hidden
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.increaseItem"></a>
## `SmartCart.increaseItem`
Increases the quantity of a cart item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
<tr>
<td>
callback
</td>
<td>
<code>function</code>
</td>
<td>
Function to call after increasing the item quantity
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.isHiddenItem"></a>
## `SmartCart.isHiddenItem` ⇒ <code>boolean</code>
Determines whether the cart item should be hidden in the Smart Cart based on product tags or properties
**Returns**: <code>boolean</code> - Boolean indicating whether the cart item should be hidden
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemCount"></a>
## `SmartCart.itemCount` ⇒ <code>number</code>
Returns the total number of items in the cart (excluding hidden items)
**Returns**: <code>number</code> - The total number of items in the cart\ <a name="SmartCart.itemHasDiscount"></a>
## `SmartCart.itemHasDiscount` ⇒ <code>boolean</code>
Determines whether the cart item has a discount
**Returns**: <code>boolean</code> - Boolean indicating whether the cart item has a discount
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemPrice"></a>
## `SmartCart.itemPrice` ⇒ <code>number</code>
Gets the price for a cart item
**Returns**: <code>number</code> - The price of the cart item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemProductTagsClasses"></a>
## `SmartCart.itemProductTagsClasses` ⇒ <code>string</code>
Gets a string of tag-based classes for the line item
**Returns**: <code>string</code> - String of tag-based classes for the line item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemProperties"></a>
## `SmartCart.itemProperties` ⇒ <code>Array.\<object></code>
Gets the line item properties to display in the cart
**Returns**: <code>Array.\<object></code> - Array of properties for the item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemPropertyClasses"></a>
## `SmartCart.itemPropertyClasses` ⇒ <code>string</code>
Gets a string of multiple property-based classes for the line item
**Returns**: <code>string</code> - String of multiple property-based classes for the line item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
<tr>
<td>
item.properties
</td>
<td>
<code>object</code>
</td>
<td>
The properties of the item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemPropertyKeyClass"></a>
## `SmartCart.itemPropertyKeyClass` ⇒ <code>string</code>
Gets a single CSS class for the line item property key
**Returns**: <code>string</code> - single CSS class for the line item property key
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
property
</td>
<td>
<code>object</code>
</td>
<td>
Line item property object (key, value)
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemPropertyValueClass"></a>
## `SmartCart.itemPropertyValueClass` ⇒ <code>string</code>
Gets a single CSS class for the line item property value
**Returns**: <code>string</code> - single CSS class for the line item property value
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
property
</td>
<td>
<code>object</code>
</td>
<td>
Line item property object (key, value)
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemURL"></a>
## `SmartCart.itemURL` ⇒ <code>string</code>
Gets the URL for a cart item
**Returns**: <code>string</code> - The URL for the cart item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.items"></a>
## `SmartCart.items` ⇒ <code>Array.\<object></code>
Returns the items in the cart
**Returns**: <code>Array.\<object></code> - Array of items in the cart\ <a name="SmartCart.itemsWithSubtotalExclusions"></a>
## `SmartCart.itemsWithSubtotalExclusions` ⇒ <code>Array.\<object></code>
Gets the cart items with or without subtotal exclusions
**Returns**: <code>Array.\<object></code> - Array of cart items
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
returnExcludedItems
</td>
<td>
<code>boolean</code>
</td>
<td>
Whether to return excluded items instead of included items
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.lineItemDiscountMessage"></a>
## `SmartCart.lineItemDiscountMessage` ⇒ <code>string</code> \| <code>null</code>
Gets the discount message for a line item
**Returns**: <code>string</code> \| <code>null</code> - The discount message or null if no discount
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.removeItem"></a>
## `SmartCart.removeItem`
Removes an item from the cart
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The cart item to remove
</td>
</tr>
<tr>
<td>
callback
</td>
<td>
<code>function</code>
</td>
<td>
Function to call after removing the item
</td>
</tr>
</tbody>
</Table>