'Removal' Operation to the Cart Transformation API for Enhanced Flexibility #213
Replies: 10 comments 14 replies
-
One other common use-case for this would be auto removal of a free gift if requirements are no longer met such as falling under a required subtotal. I am pretty sure this was possible via scripts. |
Beta Was this translation helpful? Give feedback.
-
There's another common use-case that we can handle this with forcing max-qty on a lineitem. If user order has more than allowable max quantity it would be nicer to remove it automatically. |
Beta Was this translation helpful? Give feedback.
-
Hey! thanks for the feedback. Could you elaborate more on why not using the Cart API to apply Cart Lines changes? |
Beta Was this translation helpful? Give feedback.
-
We also need this and would prefer a more versatile Our use case: we sell perishable food for local delivery (e.g. sprouts with very short shelf life). Grocery delivery is different than most other forms of e-commerce in that the customer generally selects the delivery date first, then adds items to their cart that they expect to receive on that day. Our customers set their delivery date while shopping (as a cart attribute) and then we subvert Shopify's native concept of inventory and instead display each product variant's inventory by looking up a product variant metafield hash (an object describing 3 sprouts avail tmrw, 0 avail Sat, 12 avail Sun, as A customer may select delivery for tomorrow, add 3 sprouts to cart, then change delivery date to Saturday. We want to then remove those items from the cart via a function, but currently have no way to do so. We've built a workaround using theme liquid, cart AJAX API, and a checkout UI extension calling Ideally, from a function we could get cart attributes (for the delivery date), each cart line item variant's metafields (for date-based inventory availability), then call an |
Beta Was this translation helpful? Give feedback.
-
Hello @dianacheptene , Do you have any information about an additional "edit" operation for the CartTransform : https://shopify.dev/docs/api/functions/reference/cart-transform/graphql/common-objects/cartoperation ? This feature is for some Shopify Plus a must have to fully complete the Checkout extensibility migration. |
Beta Was this translation helpful? Give feedback.
-
This feature is still very much needed. Without this, multiple online shops cannot migrate from Shopify Scripts to the Shopify Functions. Did someone find any workaround here? |
Beta Was this translation helpful? Give feedback.
-
Any news from Shopify on this subject? We still have to use Shopify Scripts as it is, because it's not possible to delete line items or adjust quantity via Shopify Functions. |
Beta Was this translation helpful? Give feedback.
-
We have a merchant that offers an assembly service for childrens furniture, someone comes to the house and assembles the furniture for them. So if someone adds a assembly product to the cart and then decides at some point before heading to the checkout to remove the product or last product that requires assembly, the asembly product should automatically be removed from the cart. Since I am using the function to modify the costs of the assembly based on metafield information on the product requiring assembly, it would be benificial to also be able to remove the product at the same time instead of having to also add javascript to the theme and monitor what products are in the cart. |
Beta Was this translation helpful? Give feedback.
-
This would be a useful feature for us as well, related to adding/removing gift wrap items. |
Beta Was this translation helpful? Give feedback.
-
This would be very helpful to create bundle automatically from item of the cart. With parent item and child items being already in the card. If i use expand it will make duplicated child that i have to remove. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone!
The Cart Transformation API is going to be a fantastic addition!
As of now, this API offers 2 "operations":
I believe it would be beneficial to introduce an additional operation, a "removal" operation, which enables the removal of a product/variant from the cart.
This operation could potentially:
The proposed
DeleteOperation
would include:ID!
Int
, optional (defaulting to the current line quantity)Alternatively, we could consider implementing a more versatile
EditOperation
or anAdjustQuantityOperation
that would allow for adjusting line item quantities.In any case, this is a concept worth delving into. I'm eager to hear your thoughts and engage in a discussion to determine the optimal solution! :)
Beta Was this translation helpful? Give feedback.
All reactions