Widget Update: We are very excited to have recently upgraded our subscription widget to v3. However, this may not work for your store. If you're having difficulty following this guide, please contact us with details.
When a Recharge product is added to the cart, we submit line item properties that determine that it's a subscription product as well as what interval. Additional properties can be specified as well.
Variables (* Required)
- subscription_id * (last digits of the URL when on the subscription ruleset page)
- shipping_interval_frequency *
- shipping_interval_unit_type *
- Monday = 0, Tuesday = 1, etc.
Passing the Properties as a Form Submit:
Below is an incomplete form for adding an item to the cart showing how the properties must be passed:
<form action="/cart/add" method="post"> <input name="properties[subscription_id]" type="hidden" value="X" /> <input name="properties[shipping_interval_frequency]" type="hidden" value="1" /> <input name="properties[shipping_interval_unit_type]" type="hidden" value="Months" /> </form>
Passing Properties via AJAX
Check out our guide for adding items to the cart via AJAX. This would be same as the linked guide, but you can add the additional parameters into the data.
Note that the 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 happens on the same day as signup.