You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! I'm John from Createur and I'm using updateItem as part of a function to ensure line item properties are attached to all cart items before the checkout.
As a result, all we're trying to do is add or change properties on the item. According to the docs, leaving quantity as undefined would be good for this, and the items would be otherwise unaffected - but I'm finding that quantity is set to 1 for that item instead.
This happens both using line index and ID, and seems to be behaviour straight through from the Shopify cart API, although not explicitly stated.
Hey! I'm John from Createur and I'm using updateItem as part of a function to ensure line item properties are attached to all cart items before the checkout.
As a result, all we're trying to do is add or change properties on the item. According to the docs, leaving quantity as
undefined
would be good for this, and the items would be otherwise unaffected - but I'm finding that quantity is set to 1 for that item instead.This happens both using line index and ID, and seems to be behaviour straight through from the Shopify cart API, although not explicitly stated.
You can try this out on Sandler:
CartJS.addItem(39335042547784, 4);
CartJS.updateItem(1, undefined);
or use the cart APIIf others agree, I would suggest changing the CartJS documentation to reflect this.
In terms of a fix, I'm wondering what the best way to go about passing through the existing quantity where none is provided would be?
The text was updated successfully, but these errors were encountered: