-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addLineItems not working with v3? #1004
Comments
Hi @larsmosr! Thanks for testing out the v3 RC and reporting this! That is not a known/intentional limitation and seems like a bug so we'll look into this. |
Hi @larsmosr! In the storefront API for this mutation it says it only accepts an array of line items as input so that's how we built v3, but upon digging into this further we discovered that the mutation works with a single object as well, and v2 of the JS Buy SDK supported that. We're going to update v3 accordingly to also support that behaviour and will have an updated RC out soon. |
This will be fixed in the next RC! Thanks for the heads up |
@larsmosr the next RC is out which includes a fix for this issue, please let us know if you are still having issues! https://www.npmjs.com/package/shopify-buy/v/3.0.0-rc.2 |
TypeError: lineItems.map is not a function
If I bump up the package to 3.0.0-rc.0 or 3.0.0-rc.1 I can't use the addLineItems function. Its still working on the older version but I need to upgrade due to the shopify changes.
It says in the "Updated .checkout methods" that there aren't any compatibility issues with the lineItems methods (addLineItem, replaceLineItems, updateLineItems, removeLineItems)
To Reproduce
Upgrade the version to 3.0.0-rc.1
// Add it to the Shopify checkout cart
const newCheckout = await shopifyClient?.checkout.addLineItems( checkout.id, newItem )
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: