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

ParamTypeDescription
propertystringproperty to get from the language object

SmartCart.hasSwitchToSubscriptionboolean

Determine if the item has the SwitchToSubscription functionality

Returns: boolean - response

ParamTypeDescription
itemobjectrebuy 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

ParamTypeDescription
itemobjectThe 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

ParamTypeDescription
itemobjectThe item object to get the selected subscription frequency for
indexnumberThe 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.

Returns the subscription frequencies for the product or the selected variant

Returns: Array. - The subscription frequencies for the item

ParamTypeDescription
itemobjectThe item object to get the subscription frequencies for

SmartCart.subscriptionOptionGroupLabelstring

Get the SwitchToSubscription subscription option group label string

Returns: string - label

ParamTypeDescription
itemobjectrebuy cart item

SmartCart.subscriptionOptionLabelstring | number | void

Get the SwitchToSubscription subscription option label string

Returns: string | number | void - label | frequency

ParamTypeDescription
itemobjectrebuy cart item
frequencynumbersubscription frequency (number of times per interval)
intervalstringsubscription 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

ParamTypeDescription
itemobjectrebuy cart item