need logic to wrap all this in array and making object like orderItems so after placing order i can pass it to database and admin panel orderslist in my project... can you help?
Hello, I have followed your code exactly the same, but the cart component is endless counting and my browser gets crashed. May you have any solution to that? If not, that would be appreciated if anywhere can share your source code to let me cross-check! Thank you!
At 17:33 , when i use that map array method in a similar way and i click on the "add to cart" button on any one of my product cards, it visually renders every product in my data set to the cart, even though the cart recognizes that i've only added one item. Some help with this asap would be greatly greatly appreciated!
Use if statement. For example if the price of an orange is $2, 3 oranges will be $6. So the if statement will be like this: If(item.price ==6){ //Your discount code }
Except for the adding of images -- tricky -- works like without a hitch. Thanks. Now I need to integrate routes and Stripe Elements. Thank you for the help.
It is very senseless that u must pass price title as only 'price' in your data or api. I have data with 'regular_price' title and react-use-cart returnes "You must pass a `price` for new items" error.
Hi i just finished this video, but whats the point of using already written functions like add, remove item ? I mean we wont learn anything like that, might be wrong, idk
@@codewithyd Wow thanks for a fast respond, didnt mean u will write anything, ive been looking for some cart related videos and out of all of them your is the best, even written like this on a simpler way, saw some written in typescript but havent seen them yet cuz i dont know typescript, any suggestions from you regarding my learning path etc? always glad to hear what pros have to say
bro please help me . i have erorr and i donot solve it (React Hook "useCart" is called in function "itemcard" that is neither a React function component)
I got this error: Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.