how can I set or remove a selling plan using update.js

Krasho
New Member
1 0 0

I am creating a custom theme using the Ajax Cart API

I have a product and the customer can chose the option to get a subscription or buy once. when the cart is empty I am using this code:

 

 

product = {
id: productVariant,
quantity: productQty,
selling_plan: sellingPlanId
}

 

The sellingPlanId could be a number or empty

if the customer return to change the options, he can remove or set the subscription and I am using the update cart option (POST /cart/update.js) 

 

jQuery.post('/cart/update.js',
  "updates[794864053]=2&updates[794864233]=3"
);

 

 

 is it possible to set the new value to selling plan?

 

thanks

 

0 Likes