Open Alba1020 opened 2 years ago
I also have this same error with total_items
Same error here. Any fix OP?
I'm having the same issue, anyone with possible solutions?
I am having the same issues. If I figure it out I will let you guys know. I think it has something to do with :
--mounting the component --the useState hook or --the icon used
https://reactjs.org/docs/react-component.html#mounting
Hey guys, I found the reason for the blank page. In the App.js, make sure these async functions are written exactly like this, don't destructure the cart yet:
const handleAddToCart = async (productId, quantity) => { const item = await commerce.cart.add(productId, quantity); setCart(item); }; const handleUpdateCart = async (productId, quantity) => { const item = await commerce.cart.update(productId, { quantity }); setCart(item); }; const handleRemoveFromCart = async (productId) => { const item = await commerce.cart.remove(productId); setCart(item); }; const handleEmptyCart = async () => { const item = await commerce.cart.empty(); setCart(item); };
Thank you @Oluwa-bunmi! That is super helpful!
@Oluwa-bunmi Thanks buddy, saved tons of time
Thank you @Oluwa-bunmi :)
I am getting these errors in console after clicking add to cart button, strangely enough when I reload the page it will show correct updated number of products. However, I still don't see anything when I go on the cart section besides the title. Anyone had this issue or maybe have any idea what is causing it