Flipcart clone - back end- controller - Cart.js

Posted at December 6, 2020 56 Views . 1 Saved .

Flipcart clone issue. TypeError: Cannot read property '_id' of null \back-end\src\controller\cart.js:108:44)

cartItems[item.product._id.toString()] = { _id: item.product._id.toString(), name: item.product.name, img: item.product.productPictures[0].img, price: item.product.price, qty: item.quantity, }

Komal Sutar
I have modified the code, as I have removed product._id as I have mention it as item._id Its working fine for now, but it will be problematic later Can you please suggest me the exact modification
Rizwan Khan
your product is null. you are not getting products