Using custom line item properties
When a subscription product is added to the cart, line item properties that define the subscription product and subscription interval are sent with the product data. You can specify custom line item properties using custom code.
This guide provides an overview of line item properties and solutions for specifying custom line item properties.
- Recharge Checkout on Shopify
Before you start
- This solution requires advanced HTML, Shopify Liquid, and JavaScript knowledge. This type of customization is not supported by Recharge Support as per our design and integration policy. If you require further assistance, please visit the Recharge Agency Partner Directory.
Line item property variables
Variable |
Allowed value |
|
Numeric value (eg. 1, 2, 3, etc.) |
|
|
|
Numeric value (eg. 1, 2, 3, etc.) |
|
|
Note: The
first_recurring_charge_delay property affects the time period between the first charge and the subsequent second charge. It does not impact the timing of the first charge. The first charge always occurs at the time of checkout. |
Numeric value (eg. 1, 2, 3, etc.) |
|
Numeric value (eg. 1, 2, 3, etc.) |
charge_on_day_of_month |
Numeric value (eg. 1, 2, 3, etc.) |
charge_on_day_of_week |
|
Pass the properties as a form submit
The following code block is an incomplete form for adding an item to the cart to demonstrate how the properties must be passed.
<form action="/cart/add" method="post">
<input name="properties[shipping_interval_frequency]" type="hidden" value="1" />
<input name="properties[shipping_interval_unit_type]" type="hidden" value="Month" />
</form>
Pass properties via AJAX
For more information on using AJAX to add a product to the cart, visit Adding an item to the cart with AJAX. This guide is a starting point for adding additional parameters to the cart.