Git Product home page Git Product logo

Comments (3)

Wullink avatar Wullink commented on June 13, 2024

Same problem here. Have you found a solution?

from ecommerce_sanity_stripe.

adhishVerma avatar adhishVerma commented on June 13, 2024

Hello. If I buy a product, I select quantity 2 and click Add to Cart button, il will appears 2 products at the bag. Ok it works great. But if I decide to buy another product. I click another product and it keeps the same quantity value of the first product. I need to change the value quantity to chose just 1 product. Does it happen with you too?

It's supposed to do that. and it's because of the way we've set the quantity, inside stateContext we change the quantity to what we want with the plus and minus options on the product page, and it is not reset when we add the item to the cart.
If you want to reset that, you will have to reset the qty, with setQty method.
If you want to reset after adding items to the cart, u have to put it inside the event handler of the cart button.
If you wanna do that if you move to some other product page, then I think you can use the useEffect hook.

from ecommerce_sanity_stripe.

Jibrand avatar Jibrand commented on June 13, 2024

I can solve this, please allow me to fork the project.
Thankyou,

from ecommerce_sanity_stripe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.