Switch to Subscription Methods

SmartCart.getSwitchToSubscriptionLabelstring

Get the SwitchToSubscription label string

SmartCart.hasSwitchToSubscriptionboolean

Determine if the item has the SwitchToSubscription functionality

SmartCart.itemDeliveryFrequencystring

Gets the item delivery frequency for a given item in the Smart Cart (if applicable) (used to render the delivery frequency in the line item properties area)

SmartCart.selectedSubscriptionFrequencystring | undefined

Gets the selected subscription frequency for a given item, either from the selected variant or the product itself

SmartCart.subscriptionDowngradeDisabledboolean

Determine if the SmartCart subscription downgrade functionality is disabled

SmartCart.subscriptionFrequenciesArray.<string>

Returns the subscription frequencies for the product or the selected variant

SmartCart.subscriptionOptionGroupLabelstring

Get the SwitchToSubscription subscription option group label string

SmartCart.subscriptionOptionLabelstring | number | void

Get the SwitchToSubscription subscription option label string

SmartCart.switchToSubscriptionEnabledboolean

Determine if the SwitchToSubscription functionality is enabled + available

SmartCart.switchToSubscriptionLabelstring

Get the SwitchToSubscription label string for the item

SmartCart.getSwitchToSubscriptionLabelstring

Get the SwitchToSubscription label string

Returns: string - label

Param

Type

Description

property

string

property to get from the language object

SmartCart.hasSwitchToSubscriptionboolean

Determine if the item has the SwitchToSubscription functionality

Returns: boolean - response

Param

Type

Description

item

object

rebuy cart item

SmartCart.itemDeliveryFrequencystring

Gets the item delivery frequency for a given item in the Smart Cart (if applicable)
(used to render the delivery frequency in the line item properties area)

Returns: string - The delivery frequency for the item

Param

Type

Description

item

object

The item object to get the delivery frequency for

SmartCart.selectedSubscriptionFrequencystring | undefined

Gets the selected subscription frequency for a given item, either from the selected variant or the product itself

Returns: string | undefined - The selected subscription frequency for the item

Param

Type

Description

item

object

The item object to get the selected subscription frequency for

index

number

The index of the subscription frequency to return (defaults to 0)

SmartCart.subscriptionDowngradeDisabledboolean

Determine if the SmartCart subscription downgrade functionality is disabled

Returns: boolean - response\

SmartCart.subscriptionFrequenciesArray.<string>

Returns the subscription frequencies for the product or the selected variant

Returns: Array.<string> - The subscription frequencies for the item

Param

Type

Description

item

object

The item object to get the subscription frequencies for

SmartCart.subscriptionOptionGroupLabelstring

Get the SwitchToSubscription subscription option group label string

Returns: string - label

Param

Type

Description

item

object

rebuy cart item

SmartCart.subscriptionOptionLabelstring | number | void

Get the SwitchToSubscription subscription option label string

Returns: string | number | void - label | frequency

Param

Type

Description

item

object

rebuy cart item

frequency

number

subscription frequency (number of times per interval)

interval

string

subscription interval (day, week, month, year)

SmartCart.switchToSubscriptionEnabledboolean

Determine if the SwitchToSubscription functionality is enabled + available

Returns: boolean - response\

SmartCart.switchToSubscriptionLabelstring

Get the SwitchToSubscription label string for the item

Returns: string - label

Param

Type

Description

item

object

rebuy cart item