Cart Items Methods

SmartCart.automaticDiscountTotalAmountSavednumber

Returns the total amount saved from automatic discounts on items in the cart

SmartCart.compareAtPricenumber | null

Gets the compare at price for a cart item

SmartCart.decreaseItem

Decreases the quantity of a cart item

SmartCart.hasAutomaticDiscountAppliedboolean

Determines whether any of the items in the cart have an automatic discount applied

SmartCart.hasItemPropertiesboolean

Determines if the cart item has any content it should render in the line item properties area in the Smart Cart

SmartCart.hasItemsboolean

Determines whether the cart has items

SmartCart.hasLineItemDiscountboolean

Determines whether the cart item has a line item discount

SmartCart.hiddenItemsArray.<object>

Returns the hidden items in the cart

SmartCart.hideQuantitySelectorsboolean

Determines whether the quantity selectors should be hidden for the cart item based on product tags or properties

SmartCart.increaseItem

Increases the quantity of a cart item

SmartCart.isHiddenItemboolean

Determines whether the cart item should be hidden in the Smart Cart based on product tags or properties

SmartCart.itemCountnumber

Returns the total number of items in the cart (excluding hidden items)

SmartCart.itemHasDiscountboolean

Determines whether the cart item has a discount

SmartCart.itemPricenumber

Gets the price for a cart item

SmartCart.itemProductTagsClassesstring

Gets a string of tag-based classes for the line item

SmartCart.itemPropertiesArray.<object>

Gets the line item properties to display in the cart

SmartCart.itemPropertyClassesstring

Gets a string of multiple property-based classes for the line item

SmartCart.itemPropertyKeyClassstring

Gets a single CSS class for the line item property key

SmartCart.itemPropertyValueClassstring

Gets a single CSS class for the line item property value

SmartCart.itemURLstring

Gets the URL for a cart item

SmartCart.itemsArray.<object>

Returns the items in the cart

SmartCart.itemsWithSubtotalExclusionsArray.<object>

Gets the cart items with or without subtotal exclusions

SmartCart.lineItemDiscountMessagestring | null

Gets the discount message for a line item

SmartCart.removeItem

Removes an item from the cart

SmartCart.automaticDiscountTotalAmountSavednumber

Returns the total amount saved from automatic discounts on items in the cart

Returns: number - the total amount saved from automatic discounts on items in the cart
(excludes items with subtotal exclusions)

SmartCart.compareAtPricenumber | null

Gets the compare at price for a cart item

Returns: number | null - The compare at price of the cart item or null if not applicable

ParamTypeDescription
itemobjectThe cart item

SmartCart.decreaseItem

Decreases the quantity of a cart item

ParamTypeDescription
itemobjectThe cart item
callbackfunctionFunction to call after decreasing the item quantity

SmartCart.hasAutomaticDiscountAppliedboolean

Determines whether any of the items in the cart have an automatic discount applied

Returns: boolean - Boolean indicating whether any of the items in the cart have an automatic discount applied

SmartCart.hasItemPropertiesboolean

Determines if the cart item has any content it should render in the line item properties area in the Smart Cart

Returns: boolean - Whether the cart item has any properties to render (or a delivery frequency with Switch to Subscription disabled)

ParamTypeDescription
itemobjectThe cart item object to check for properties

SmartCart.hasItemsboolean

Determines whether the cart has items

Returns: boolean - Boolean indicating whether the cart has items

SmartCart.hasLineItemDiscountboolean

Determines whether the cart item has a line item discount

Returns: boolean - Boolean indicating whether the cart item has a line item discount

ParamTypeDescription
itemobjectThe cart item

SmartCart.hiddenItemsArray.