All Questions
Tagged with shopping-cart reactjs
72
questions
1
vote
1
answer
41
views
How to add quantities from a specific items in React
i have an array like this
const products = [
{ id: 1, name: "Apple", price: 10, img: "apple.jpg" },
{ id: 2, name: "Banana", price: 20, img: "banana.jpg" },
...
0
votes
1
answer
47
views
How to initialize a state with use reducer so it don't clear on reload in React
I am working on a react shopping e-commerce website and i am using useContext and useReducer to set my cart state but each time i add to cart and reload the page my cart clears and reinitialize
each ...
0
votes
2
answers
204
views
Add Same Product with different sizes and prices to the cart
I can add different products as individual arrays and I can also increase and decrease the quantities if the same product added. But I would want to add same product with different size. Below is my ...
0
votes
1
answer
736
views
Adding quantity of all items in cart and not just 1 number per specific id
So I've got my cart up and running. The total price reflects all items in the cart, but the only issue is you can't tell how many total items there are. If I have one of an item that's fine since the ...
0
votes
1
answer
54
views
After add existing Item into cart, other value become null
So my im trying to create a cart using Context and Local storage. with add to cart already done and work. But when im trying to add item that already in cart i get this error. I use find() and map() ...
1
vote
0
answers
37
views
Filtering by price not working in Reactjs
I expect the list of products will change after I slide the slider, but nothing happened. The list still the same.
Main component:
import Left from "./Left"
import Content from "./...
-1
votes
2
answers
132
views
When the functions are passed as props, is the shopping cart unable to render?
I am in the process of creating a shopping page which contains an array of items, I have also implemented functions such as "addToCart", "removeFromCart", "increaseQuantity&...
0
votes
1
answer
89
views
Cart Item not remove or empty after checkout process in POS application in MERN. like await cartItems.findAndUpdate({ $set: { cartItems: [] } });
i have created POS point of sale application in MERN that is working perfectly fine just there are two problems.
Cart Item not remove or empty after checkout process
cart items remains same it didn't ...
0
votes
2
answers
549
views
Uncaught TypeError: Cannot read properties of undefined (reading 'push') for shopping cart project
I'm creating shooping cart that can add product to cart page. But when I click the add to cart button, there is an error "Uncaught TypeError: Cannot read properties of undefined (reading 'push')&...
0
votes
1
answer
46
views
after adding two list delete cycle is not property working in react useReducer?
I am creating a shopping cart lit application, in that program add functionality is fine but when I add one list then another
enter code here
and then remove the one that is fine but when you want to ...
-3
votes
1
answer
224
views
Add to Shopping cart functionality(React+TypesScript+Tailwind css)
I am facing a problem in updating the cart badge number as I click the "add to cart" button.
This is the Link to my entire code on Githhub.
1
vote
1
answer
41
views
Blank page when trying to render props passed via Link route
I get a blank page when I try to render cart items passed from another page via Link.
When I console.log it works fine and shows an array.
How can I render them, this way or any other? I use the ...
0
votes
0
answers
56
views
How to add Objects into an array using push method
I want to add an object when I click Add to Cart Button. I want to add cartItems when clicked and want all the cart items into the cart one by one when I click addToCart button. But I don't want to ...
1
vote
0
answers
132
views
I'm trying to add and item to cart, and also delete it through the clear cart button
I'm trying to add an item to the cart, and also delete it through the clear cart button. I hope I have pasted the necessary code correctly. Had tried to work on it but after a few failing tests, ...
0
votes
2
answers
741
views
how to calculate the total price of your cart
I was creating a shopping cart using react and redux and everything works perfectly without any errors I'm wondering how do I calculate the total price by adding up all the items in the cart
my cart-...