This came from the cart.js API. The variable is const cart_token = cart.token;
id attempt #1:
gid://shopify/CartLine/1
This came from incrementing in the line-items foreach loop.
id attempt #2:
gid://shopify/CartLine/47572753711389
This came from the cart.js API. I noticed the ID is the same as the variant ID. The variables are const line_items = cart.items; and const line_id = line_item.id;
It seems that the format “attempt#1” and “attempt#2” you mentioned follows the format of merchandise fields, rather than the cart line ID format.
@anxiouspenguin , I am having the exact same use case as you, tried all the things you tried and am running into the same problem. Funny your post is only 3 days old!
Have you been able to fix it already? The problem still persists for me unfortunately.
There it’s clearly stated to do it this way, and if something isn’t correct about this way of doing it, then Shopify should urgently update their documentation!
What is the CartLine Global ID format? Where and how did you get your CartLine Global ID? As @Tobi-van mentioned, there is no Line ID like this mentioned in any documentation or even on the internet that I can find. The Line ID is always mentioned as Variant ID or a Line Key but neither of those work and neither of those are formatted like your Line ID. Your help is much appreciated!