//display cart and subtotals if $_SESSION['cart'] is not empty $cart_total=0.0; echo html form action cart.php method POST for each in $_SESSION['cart'] as $prod_id =>$cartQnty query database's Products table and select name, sku, and price where prod_id is equal to $prod_id. if the query was successful, fetch the row by association. Display the name and sku first. Then display an html input type=number where name is equal to $prod_id, min=0, and value=$cartQnty Finally calculate the queried price * $cartQnty and display the sub price for the item(s) in $monetary.00 format. Update the running cart_total with sub price else the query was unsuccessful, optionally, could unset $_SESSION['cart'][$prod_id] or continue (skip) end_foreach echo the $cart_total in monetary format echo a submit button name = 'action' value = 'Empty Cart' echo a submit button name = 'action' value = 'Update Cart' endif //end display cart and subtotals