Code Monkey home page Code Monkey logo

Comments (11)

Pannu786 avatar Pannu786 commented on May 31, 2024

I am still stuck!! and this is sucks.. I can't figure out what's going wrong here. HELPPPP

from ecommerce_sanity_stripe.

miahthegreat avatar miahthegreat commented on May 31, 2024

@Pannu786 I ended up modifying the code a bit. You don't have to use the sort function. Also don't mind the classes, I styled mine with Tailwind.image

from ecommerce_sanity_stripe.

Pannu786 avatar Pannu786 commented on May 31, 2024

wow, you are adding your own stuff and making changes, not like me(dumb zombie) haha.. This is cool that you are using tailwind for styling really impressive. I tried replacing "item" with "product" but still got the same issue.
Screenshot 2022-05-18 130030

from ecommerce_sanity_stripe.

miahthegreat avatar miahthegreat commented on May 31, 2024

Can you post the code for the entire file for me please?

from ecommerce_sanity_stripe.

Pannu786 avatar Pannu786 commented on May 31, 2024

yes sure, sorry couldn't fit the whole code on one page so I took 3 pages. Hope it is readable to you.
Screenshot 2022-05-18 132630
Screenshot 2022-05-18 132702
Screenshot 2022-05-18 132729

from ecommerce_sanity_stripe.

miahthegreat avatar miahthegreat commented on May 31, 2024

When you console.log the product, is it showing an image array within the object?

from ecommerce_sanity_stripe.

Pannu786 avatar Pannu786 commented on May 31, 2024

Nope, I am not getting the object except the same errors. Do you think it could be something to do with the [slug] file or other from where I am getting the product properties?

Screenshot 2022-05-18 134955

from ecommerce_sanity_stripe.

miahthegreat avatar miahthegreat commented on May 31, 2024

It could be. I would double check the StateContext and slug to make sure the addToCart function is passing all the right information.

from ecommerce_sanity_stripe.

Pannu786 avatar Pannu786 commented on May 31, 2024

I know I am asking a lot but when you got time could you please have a look? I am at that stage where I am gonna start to pull my hair 😓

StateContext file

Screenshot 2022-05-18 140838
Screenshot 2022-05-18 140913
Screenshot 2022-05-18 140959

slug file

Screenshot 2022-05-18 142448
Screenshot 2022-05-18 142521
Screenshot 2022-05-18 142545
Screenshot 2022-05-18 142606
Screenshot 2022-05-18 142629
Screenshot 2022-05-18 142648

from ecommerce_sanity_stripe.

miahthegreat avatar miahthegreat commented on May 31, 2024

@Pannu786 Try updating the onAdd function in StateContext with this logic.

image

from ecommerce_sanity_stripe.

Pannu786 avatar Pannu786 commented on May 31, 2024

I tried but got another error.
Screenshot 2022-05-18 151101

Thanks for the effort anyway.

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.