April 2020
Intermediate to advanced
716 pages
18h 55m
English
In this section, we will implement a ProductOrderEdit component to render all the products in the order with an edit status option. This ProductOrderEdit component will take an order object as a prop and iterate through the order's products array to display only the products that have been purchased from the current shop, along with a dropdown to change the status value of each product. The code for this view, which renders the products for each order, will be added as follows.
mern-marketplace/client/order/ProductOrderEdit.js:
{props.order.products.map((item, index) => { return <span key={index}> { item.shop == props.shopId && <ListItem button> <ListItemText primary={ <div> <img src= {'/api/product/image/'+item.product._id}/> ...Read now
Unlock full access