Cannot apply cart line item properties pre/post merge operation #397
Replies: 4 comments 4 replies
-
Another implication of this which makes it kind of impossible to offer real Mix&Match apps which use the merge function ist that two bundles sharing the same parent product but not the same configuration, receive the same "Key" value in the cart object as well in liquid as in the Ajax API. Little explanation of how they are created from the docs: Line item keys are unique!!!! identifiers that consist of the following components separated by a colon: Since technically the products have exactly the same variant and also the same properties (and we can't change them), these products receive the same Key even though they have different item components and appear as two seperate line items. Many themes use this key for the cart ajax API to make updates to line items or delete them ([https://shopify.dev/docs/api/ajax/reference/cart#post-locale-cart-change-js]). So if you actaully have access to the theme you can just change the way the ajax api is used but as app developer we have no chance, no possible workaround to add two products with the same parent to the cart which kills the whole point of the merge feature which is that we don't have to create a seperate product for each possible bundle config anymore. I think this could either be solved by the functions team by adding the possibility to edit line items just like we can change the title and image or by the team responsible for how Shopify's cart handles the creation of the key. I'll also open a post in the community forums for this hoping this gets to the right team. A quick hotfix could be just automatically add a unique, hidden "bundle-id"(or something similar) attribute to each line item created by a merge operation. We have an app completely ready, approved in the app store but we can not mak eit compatible with 90% of the themes because they all use that key. If you need a demo or further explanation on this shoot me a message in the Shopify Slack (Marvin Siekmann). |
Beta Was this translation helpful? Give feedback.
-
Is there an update from anyone at Shopify for this issue? Also appreciate the previous post for outlining the detail! |
Beta Was this translation helpful? Give feedback.
-
Followed up on this thread/ticket with partner support as I haven't seen any updates in the developer change log. Hope to have some updates soon. |
Beta Was this translation helpful? Give feedback.
-
Another issue where a year has passed without any updates, I really need this feature for building a better user experience. I can only stop the cart transforms for now…… |
Beta Was this translation helpful? Give feedback.
-
In testing Cart transforms, if child variants of a bundle have line item properties, they are omitted when the variants are merged into the parent bundle product. Post merge, the
properties
object of the bundle cart item is an empty object{}
.I also tried adding line item properties via the
change.js
endpoint of the Cart Ajax API. No matter how many different ways I tried to apply line item properties (line, id, key
), the change is successful (200 response code
), yet upon fetching the cart, the cart itemproperties
object was always empty{}
Short of "applying" line item properties of a cart line using front-end JS/DOM, will line item properties be supported with Cart Transforms?
Beta Was this translation helpful? Give feedback.
All reactions