Switch to Subscription Methods
- SmartCart.getSwitchToSubscriptionLabel ⇒
string
-
Get the SwitchToSubscription label string
- SmartCart.hasSwitchToSubscription ⇒
boolean
-
Determine if the item has the SwitchToSubscription functionality
- 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)
- SmartCart.selectedSubscriptionFrequency ⇒
string | undefined
-
Gets the selected subscription frequency for a given item, either from the selected variant or the product itself
- SmartCart.subscriptionDowngradeDisabled ⇒
boolean
-
Determine if the SmartCart subscription downgrade functionality is disabled
- SmartCart.subscriptionFrequencies ⇒
Array.<string>
-
Returns the subscription frequencies for the product or the selected variant
- SmartCart.subscriptionOptionGroupLabel ⇒
string
-
Get the SwitchToSubscription subscription option group label string
- SmartCart.subscriptionOptionLabel ⇒
string | number | void
-
Get the SwitchToSubscription subscription option label string
- SmartCart.switchToSubscriptionEnabled ⇒
boolean
-
Determine if the SwitchToSubscription functionality is enabled + available
- SmartCart.switchToSubscriptionLabel ⇒
string
-
Get the SwitchToSubscription label string for the item
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.\
Returns the subscription frequencies for the product or the selected variant
Returns: Array.\ - 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
|
---
title: Switch to Subscription Methods
excerpt: Convert one-time purchases to subscriptions in cart
deprecated: false
hidden: false
metadata:
title: ''
description: ''
robots: index
next:
description: Return to the New Methods Overview Page to see other available methods.
pages:
- type: endpoint
slug: smart-cart-methods
title: Methods Overview - New
---
<dl>
<dt><a href="#SmartCart.getSwitchToSubscriptionLabel">SmartCart.getSwitchToSubscriptionLabel</a> ⇒ <code>string</code></dt>
<dd>
<p>Get the SwitchToSubscription label string</p>
</dd>
<dt><a href="#SmartCart.hasSwitchToSubscription">SmartCart.hasSwitchToSubscription</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determine if the item has the SwitchToSubscription functionality</p>
</dd>
<dt><a href="#SmartCart.itemDeliveryFrequency">SmartCart.itemDeliveryFrequency</a> ⇒ <code>string</code></dt>
<dd>
<p>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)</p>
</dd>
<dt><a href="#SmartCart.selectedSubscriptionFrequency">SmartCart.selectedSubscriptionFrequency</a> ⇒ <code>string</code> | <code>undefined</code></dt>
<dd>
<p>Gets the selected subscription frequency for a given item, either from the selected variant or the product itself</p>
</dd>
<dt><a href="#SmartCart.subscriptionDowngradeDisabled">SmartCart.subscriptionDowngradeDisabled</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determine if the SmartCart subscription downgrade functionality is disabled</p>
</dd>
<dt><a href="#SmartCart.subscriptionFrequencies">SmartCart.subscriptionFrequencies</a> ⇒ <code>Array.<string></code></dt>
<dd>
<p>Returns the subscription frequencies for the product or the selected variant</p>
</dd>
<dt><a href="#SmartCart.subscriptionOptionGroupLabel">SmartCart.subscriptionOptionGroupLabel</a> ⇒ <code>string</code></dt>
<dd>
<p>Get the SwitchToSubscription subscription option group label string</p>
</dd>
<dt><a href="#SmartCart.subscriptionOptionLabel">SmartCart.subscriptionOptionLabel</a> ⇒ <code>string</code> | <code>number</code> | <code>void</code></dt>
<dd>
<p>Get the SwitchToSubscription subscription option label string</p>
</dd>
<dt><a href="#SmartCart.switchToSubscriptionEnabled">SmartCart.switchToSubscriptionEnabled</a> ⇒ <code>boolean</code></dt>
<dd>
<p>Determine if the SwitchToSubscription functionality is enabled + available</p>
</dd>
<dt><a href="#SmartCart.switchToSubscriptionLabel">SmartCart.switchToSubscriptionLabel</a> ⇒ <code>string</code></dt>
<dd>
<p>Get the SwitchToSubscription label string for the item</p>
</dd>
</dl>
<a name="SmartCart.getSwitchToSubscriptionLabel"></a>
## `SmartCart.getSwitchToSubscriptionLabel` ⇒ <code>string</code>
Get the SwitchToSubscription label string
**Returns**: <code>string</code> - label
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
property
</td>
<td>
<code>string</code>
</td>
<td>
property to get from the language object
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.hasSwitchToSubscription"></a>
## `SmartCart.hasSwitchToSubscription` ⇒ <code>boolean</code>
Determine if the item has the SwitchToSubscription functionality
**Returns**: <code>boolean</code> - response
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
rebuy cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.itemDeliveryFrequency"></a>
## `SmartCart.itemDeliveryFrequency` ⇒ <code>string</code>
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**: <code>string</code> - The delivery frequency for the item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The item object to get the delivery frequency for
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.selectedSubscriptionFrequency"></a>
## `SmartCart.selectedSubscriptionFrequency` ⇒ <code>string</code> \| <code>undefined</code>
Gets the selected subscription frequency for a given item, either from the selected variant or the product itself
**Returns**: <code>string</code> \| <code>undefined</code> - The selected subscription frequency for the item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The item object to get the selected subscription frequency for
</td>
</tr>
<tr>
<td>
index
</td>
<td>
<code>number</code>
</td>
<td>
The index of the subscription frequency to return (defaults to 0)
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.subscriptionDowngradeDisabled"></a>
## `SmartCart.subscriptionDowngradeDisabled` ⇒ <code>boolean</code>
Determine if the SmartCart subscription downgrade functionality is disabled
**Returns**: <code>boolean</code> - response\ <a name="SmartCart.subscriptionFrequencies"></a>
## `SmartCart.subscriptionFrequencies` ⇒ <code>Array.\<string></code>
Returns the subscription frequencies for the product or the selected variant
**Returns**: <code>Array.\<string></code> - The subscription frequencies for the item
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
The item object to get the subscription frequencies for
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.subscriptionOptionGroupLabel"></a>
## `SmartCart.subscriptionOptionGroupLabel` ⇒ <code>string</code>
Get the SwitchToSubscription subscription option group label string
**Returns**: <code>string</code> - label
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
rebuy cart item
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.subscriptionOptionLabel"></a>
## `SmartCart.subscriptionOptionLabel` ⇒ <code>string</code> \| <code>number</code> \| <code>void</code>
Get the SwitchToSubscription subscription option label string
**Returns**: <code>string</code> \| <code>number</code> \| <code>void</code> - label | frequency
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
rebuy cart item
</td>
</tr>
<tr>
<td>
frequency
</td>
<td>
<code>number</code>
</td>
<td>
subscription frequency (number of times per interval)
</td>
</tr>
<tr>
<td>
interval
</td>
<td>
<code>string</code>
</td>
<td>
subscription interval (day, week, month, year)
</td>
</tr>
</tbody>
</Table>
<a name="SmartCart.switchToSubscriptionEnabled"></a>
## `SmartCart.switchToSubscriptionEnabled` ⇒ <code>boolean</code>
Determine if the SwitchToSubscription functionality is enabled + available
**Returns**: <code>boolean</code> - response\ <a name="SmartCart.switchToSubscriptionLabel"></a>
## `SmartCart.switchToSubscriptionLabel` ⇒ <code>string</code>
Get the SwitchToSubscription label string for the item
**Returns**: <code>string</code> - label
<Table>
<thead>
<tr>
<th>
Param
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
item
</td>
<td>
<code>object</code>
</td>
<td>
rebuy cart item
</td>
</tr>
</tbody>
</Table>