How to remove selling_plan from a item in the cart

Hi guys,

I am adding some items in my cart passing the selling_plan props and everything works fine till here.

But i need to either remove it from some items in the cart or add it using the /cart/update.js or /cart/change.js endpoints.

Can anyone give me some light how to reach such result?

Example:

A customer add a item without selling_plan to the cart and after the item is added, the same customer wants now to subscribe to this item so i have to pass the selling plan id to this item that is already in the cart. the inverse situation is also needed.

Thanks

For now the only solution I have is to delete the item from the cart and then add it again with or without the selling plan id… not good but working.

I am doing the same (removing and re-adding item without selling_plan).

What’s the process for surfacing this as a request to be included in change.js?

1 Like

Also trying to do the same. Is there any documentation or samples available?

1 Like

Currently, it’s possible to remove the selling plan by setting its value to null:

{
  'line': 2,
  'quantity': 2,
  'selling_plan': null
}

Works both with Ajax Rest API and with GQL Storefront API.

Here are docs (in the code example select the “Remove selling plan” tab):
https://shopify.dev/docs/api/ajax/reference/cart#update-selling-plans

1 Like