For the cart view in orders app, implement POST method.
When using POST, data of the food id and quantity will be sent with request. Take them from the request and add them to the cookie associated with cart named cart. (Do not forget to get the cookie at first, then use eval function on it. then add the food id as the key and quntity as the value to this dict. then again make it a string and set this string as the cookie for cart).
Then after all of these, redirect them to the menu url.
For the
cart
view inorders
app, implement POST method.When using POST, data of the food id and quantity will be sent with request. Take them from the request and add them to the cookie associated with cart named
cart
. (Do not forget to get the cookie at first, then useeval
function on it. then add the food id as the key and quntity as the value to this dict. then again make it a string and set this string as the cookie forcart
).Then after all of these, redirect them to the
menu
url.