Closed shivampatel22 closed 1 year ago
You have to add ...
request.session['coupon_id'] = None
after ...
cart.clear()
in cart's views.py
Thank you @PRCervera.
@shivampatel22 as @PRCervera mentions, you can remove coupon_id
from the session in orders/views.py
after clearing the cart in this line: https://github.com/PacktPublishing/Django-4-by-example/blob/f4d6a3df49fb851b96466bf6327dc93cc24f8f58/Chapter11/myshop/orders/views.py#L30
Thanks @PRCervera and @zenx.
I spent a little time thinking why the coupon stays in the session, then I thought I had missed this point in the book. Nice issue
'coupon_id' should be removed from session after checkout is complete.
Steps to replicate