How to add a ReCharge subscription to the cart using the Buy SDK (JavaScript)

Solved
Highlighted
New Member
2 0 1

I'm building a custom storefront, using the Shopify Buy SDK in JavaScript. I'm able to add regular product to the cart, but I can't figure out how to add ReCharge subscriptions. I have all the data that should be needed, the ruleset_id, the variant id, the frequency, the frequency unit, but can't see how to add the subscription properties to the addLineItems.

Any insight would be appreciated!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
491 97 88

This is an accepted solution.

Hi @thomasboulongne 

 

I would suggest speaking with ReCharge about this for specific details. The basics of the implementation usually is that the option to choose a subscription would be chosen at the cart page or the product page. When I say “cart” here, it would be your created cart using the checkout object. The way i’ve seen it is you will have a button that redirects to a blank page on Shopify. That page automatically adds items to the cart via ajax (the blank page would be an online store generated page and could be served in an iframe). First Add an Item to Cart with AJAX, and from there redirect to the Recharge checkout. 

 

 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
Highlighted
New Member
1 0 0

Hi! Did you ever find out a solution for this?

0 Likes