- SmartCart.automaticDiscountTotalAmountSaved ⇒
number Returns the total amount saved from automatic discounts on items in the cart
- SmartCart.compareAtPrice ⇒
number|null Gets the compare at price for a cart item
- SmartCart.decreaseItem
Decreases the quantity of a cart item
- SmartCart.hasAutomaticDiscountApplied ⇒
boolean Determines whether any of the items in the cart have an automatic discount applied
- SmartCart.hasItemProperties ⇒
boolean Determines if the cart item has any content it should render in the line item properties area in the Smart Cart
- SmartCart.hasItems ⇒
boolean Determines whether the cart has items
- SmartCart.hasLineItemDiscount ⇒
boolean Determines whether the cart item has a line item discount
- SmartCart.hiddenItems ⇒
Array.<object> Returns the hidden items in the cart
- SmartCart.hideQuantitySelectors ⇒
boolean 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.isHiddenItem ⇒
boolean Determines whether the cart item should be hidden in the Smart Cart based on product tags or properties
- SmartCart.itemCount ⇒
number Returns the total number of items in the cart (excluding hidden items)
- SmartCart.itemHasDiscount ⇒
boolean Determines whether the cart item has a discount
- SmartCart.itemPrice ⇒
number Gets the price for a cart item
- SmartCart.itemProductTagsClasses ⇒
string Gets a string of tag-based classes for the line item
- SmartCart.itemProperties ⇒
Array.<object> Gets the line item properties to display in the cart
- SmartCart.itemPropertyClasses ⇒
string Gets a string of multiple property-based classes for the line item
- SmartCart.itemPropertyKeyClass ⇒
string Gets a single CSS class for the line item property key
- SmartCart.itemPropertyValueClass ⇒
string Gets a single CSS class for the line item property value
- SmartCart.itemURL ⇒
string Gets the URL for a cart item
- SmartCart.items ⇒
Array.<object> Returns the items in the cart
- SmartCart.itemsWithSubtotalExclusions ⇒
Array.<object> Gets the cart items with or without subtotal exclusions
- SmartCart.lineItemDiscountMessage ⇒
string|null Gets the discount message for a line item
- SmartCart.removeItem
Removes an item from the cart
SmartCart.automaticDiscountTotalAmountSaved ⇒ number
SmartCart.automaticDiscountTotalAmountSaved ⇒ numberReturns 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.compareAtPrice ⇒ number | null
SmartCart.compareAtPrice ⇒ number | nullGets the compare at price for a cart item
Returns: number | null - The compare at price of the cart item or null if not applicable
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.decreaseItem
SmartCart.decreaseItemDecreases the quantity of a cart item
Param | Type | Description |
|---|---|---|
item | object | The cart item |
callback | function | Function to call after decreasing the item quantity |
SmartCart.hasAutomaticDiscountApplied ⇒ boolean
SmartCart.hasAutomaticDiscountApplied ⇒ booleanDetermines 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.hasItemProperties ⇒ boolean
SmartCart.hasItemProperties ⇒ booleanDetermines 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)
Param | Type | Description |
|---|---|---|
item | object | The cart item object to check for properties |
SmartCart.hasItems ⇒ boolean
SmartCart.hasItems ⇒ booleanDetermines whether the cart has items
Returns: boolean - Boolean indicating whether the cart has items\
SmartCart.hasLineItemDiscount ⇒ boolean
SmartCart.hasLineItemDiscount ⇒ booleanDetermines whether the cart item has a line item discount
Returns: boolean - Boolean indicating whether the cart item has a line item discount
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.hiddenItems ⇒ Array.<object>
SmartCart.hiddenItems ⇒ Array.<object>Returns the hidden items in the cart
Returns: Array.<object> - Array of hidden items in the cart\
SmartCart.hideQuantitySelectors ⇒ boolean
SmartCart.hideQuantitySelectors ⇒ booleanDetermines whether the quantity selectors should be hidden for the cart item
based on product tags or properties
Returns: boolean - Boolean indicating whether the quantity selectors should be hidden
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.increaseItem
SmartCart.increaseItemIncreases the quantity of a cart item
Param | Type | Description |
|---|---|---|
item | object | The cart item |
callback | function | Function to call after increasing the item quantity |
SmartCart.isHiddenItem ⇒ boolean
SmartCart.isHiddenItem ⇒ booleanDetermines whether the cart item should be hidden in the Smart Cart based on product tags or properties
Returns: boolean - Boolean indicating whether the cart item should be hidden
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.itemCount ⇒ number
SmartCart.itemCount ⇒ numberReturns the total number of items in the cart (excluding hidden items)
Returns: number - The total number of items in the cart\
SmartCart.itemHasDiscount ⇒ boolean
SmartCart.itemHasDiscount ⇒ booleanDetermines whether the cart item has a discount
Returns: boolean - Boolean indicating whether the cart item has a discount
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.itemPrice ⇒ number
SmartCart.itemPrice ⇒ numberGets the price for a cart item
Returns: number - The price of the cart item
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.itemProductTagsClasses ⇒ string
SmartCart.itemProductTagsClasses ⇒ stringGets a string of tag-based classes for the line item
Returns: string - String of tag-based classes for the line item
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.itemProperties ⇒ Array.<object>
SmartCart.itemProperties ⇒ Array.<object>Gets the line item properties to display in the cart
Returns: Array.<object> - Array of properties for the item
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.itemPropertyClasses ⇒ string
SmartCart.itemPropertyClasses ⇒ stringGets a string of multiple property-based classes for the line item
Returns: string - String of multiple property-based classes for the line item
Param | Type | Description |
|---|---|---|
item | object | The cart item |
item.properties | object | The properties of the item |
SmartCart.itemPropertyKeyClass ⇒ string
SmartCart.itemPropertyKeyClass ⇒ stringGets a single CSS class for the line item property key
Returns: string - single CSS class for the line item property key
Param | Type | Description |
|---|---|---|
property | object | Line item property object (key, value) |
SmartCart.itemPropertyValueClass ⇒ string
SmartCart.itemPropertyValueClass ⇒ stringGets a single CSS class for the line item property value
Returns: string - single CSS class for the line item property value
Param | Type | Description |
|---|---|---|
property | object | Line item property object (key, value) |
SmartCart.itemURL ⇒ string
SmartCart.itemURL ⇒ stringGets the URL for a cart item
Returns: string - The URL for the cart item
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.items ⇒ Array.<object>
SmartCart.items ⇒ Array.<object>Returns the items in the cart
Returns: Array.<object> - Array of items in the cart\
SmartCart.itemsWithSubtotalExclusions ⇒ Array.<object>
SmartCart.itemsWithSubtotalExclusions ⇒ Array.<object>Gets the cart items with or without subtotal exclusions
Returns: Array.<object> - Array of cart items
Param | Type | Description |
|---|---|---|
returnExcludedItems | boolean | Whether to return excluded items instead of included items |
SmartCart.lineItemDiscountMessage ⇒ string | null
SmartCart.lineItemDiscountMessage ⇒ string | nullGets the discount message for a line item
Returns: string | null - The discount message or null if no discount
Param | Type | Description |
|---|---|---|
item | object | The cart item |
SmartCart.removeItem
SmartCart.removeItemRemoves an item from the cart
Param | Type | Description |
|---|---|---|
item | object | The cart item to remove |
callback | function | Function to call after removing the item |
