All things Shopify and commerce
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
Solved! Go to the solution
This is an accepted solution.
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.
This is an accepted solution.
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?
Also trying to do the same. Is there any documentation or samples available?
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
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024