May 2018
Intermediate to advanced
470 pages
13h 54m
English
The ProductOrderEdit component takes an order object as a prop, and iterates through the order's products array to display only the products purchased from the current shop, along with a dropdown to change the status value of each product.
mern-marketplace/client/order/ProductOrderEdit.js:
{this.props.order.products.map((item, index) => { return <span key={index}> { item.shop == this.props.shopId && <ListItem button> <ListItemText primary={ <div> <img src= {'/api/product/image/'+item.product._id}/> {item.product.name} <p>{"Quantity: "+item.quantity}</p> </div>}/> <TextField id="select-status" select label="Update Status" value={item.status} onChange={this.handleStatusChange(index)} SelectProps={{ MenuProps: ...Read now
Unlock full access