Switch to Subscription Methods
SmartCart.getSwitchToSubscriptionLabel ⇒ string¶
Get the SwitchToSubscription label string
Returns: string - label
| Param | Type | Description |
|---|---|---|
| property | string |
property to get from the language object |
SmartCart.hasSwitchToSubscription ⇒ boolean¶
Determine if the item has the SwitchToSubscription functionality
Returns: boolean - response
| Param | Type | Description |
|---|---|---|
| item | object |
rebuy cart item |
SmartCart.itemDeliveryFrequency ⇒ string¶
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.selectedSubscriptionFrequency ⇒ string | 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.subscriptionDowngradeDisabled ⇒ boolean¶
Determine if the SmartCart subscription downgrade functionality is disabled
Returns: boolean - response ## SmartCart.subscriptionFrequencies ⇒ Array.<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.subscriptionOptionGroupLabel ⇒ string¶
Get the SwitchToSubscription subscription option group label string
Returns: string - label
| Param | Type | Description |
|---|---|---|
| item | object |
rebuy cart item |
SmartCart.subscriptionOptionLabel ⇒ string | 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.switchToSubscriptionEnabled ⇒ boolean¶
Determine if the SwitchToSubscription functionality is enabled + available
Returns: boolean - response ## SmartCart.switchToSubscriptionLabel ⇒ string
Get the SwitchToSubscription label string for the item
Returns: string - label
| Param | Type | Description |
|---|---|---|
| item | object |
rebuy cart item |