Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

react-graphql-client: Error message when adding product to cart #109

Open
ryangrunest opened this issue Feb 7, 2020 · 5 comments
Open

Comments

@ryangrunest
Copy link

Currently, there's an error message when adding a product to the cart:
App.js:136 Uncaught ReferenceError: client is not defined

To fix this issue, in the addVariantToCart function within App.js, add the following:
const client = this.props.client;
and change each this.props.client to client.

@ryangrunest
Copy link
Author

I've made the changes on a local branch, but I don't have rights to push branches up for this repository.

@swalkinshaw
Copy link
Collaborator

@ryangrunest you can fork the repo and then do a PR from there

@ryangrunest
Copy link
Author

Pull Request: #110

@ryangrunest
Copy link
Author

To test this issue, I connected to my storefront within src/index.js, and attempted adding a product to the cart.

enkelmedia pushed a commit to Obviuse/storefront-api-examples that referenced this issue Jan 21, 2021
@mahaboobkhan29
Copy link

@swalkinshaw
how can i update the existing cart lineitem i can find shopify doc to increase the quantity of product that already in cart
Ref: https://shopify.dev/custom-storefronts/cart#increase-an-items-quantity

but i want to add another product in the same cart by using cart id
i can see using checkout craete we can use checkoutLineItemsReplace to remove the existing lineitem and replace with new lineitem
as like is possible in cart?

Pls reply

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants