Create the cart template which has to show the customer what items they have chosen to order.
This templates receives a context like this:
context = {
"cart" : {
FOOD_OBJECT: QUANTITY
}
}
You have to display their cart showing what items (and how many of it) they have chosen.
You also need to link all the foods to their own url
All items must have a button to delete from the cart.
This means you have to make form for each food that only contains a button to delete it from the cart.
The action and method of the form: POST to cart_delete url
This button must have the "food" as it's html tag name and food.id as the html tag value so the view can handle the deletion.
Create the
cart
template which has to show the customer what items they have chosen to order. This templates receives a context like this:You have to display their cart showing what items (and how many of it) they have chosen. You also need to link all the foods to their own url
All items must have a button to delete from the cart. This means you have to make form for each food that only contains a button to delete it from the cart. The action and method of the form:
POST
tocart_delete
url This button must have the "food" as it's html tag name andfood.id
as the html tag value so the view can handle the deletion.