April 2020
Intermediate to advanced
716 pages
18h 55m
English
The CartItems component will allow the user to view and update the items currently in their cart. It will also give them the option to start the checkout process if they are signed in, as shown in the following screenshot:

If the cart contains items, the CartItems component iterates over the items and renders the products in the cart. If no items have been added, the cart view just displays a message stating that the cart is empty. The code for this implementation is as follows.
mern-marketplace/client/cart/CartItems.js:
{cartItems.length > 0 ? <span> {cartItems.map((item, i) => { ... … Display product details … Edit ...