django-shopping-cart icon indicating copy to clipboard operation
django-shopping-cart copied to clipboard

Django shopping cart total amount

Open GannTrader opened this issue 5 years ago • 5 comments

hi i want to know how i can total amount of all products?

GannTrader avatar Aug 03 '20 11:08 GannTrader

I will update it tomorrow.Thanks

MahmudulHassan5809 avatar Aug 03 '20 19:08 MahmudulHassan5809

Hi!

This would be a great feature, yet it is still not there.

johnnyunar avatar Nov 24 '20 09:11 johnnyunar

hello @MahmudulHassan5809 could you please kindly add that small feature where i can get the total amount of all products

muhacodes avatar Dec 25 '21 10:12 muhacodes

Edit this this in veiws.py

@login_required(login_url="/users/login") def cart_detail(request): total_amt = 0 for id,item in request.session['cart'].items(): total_amt+= int(item['quantity'])*float(item['price']) return render(request, 'cart_detail.html', {'total': total_amt})

maazshipra avatar Aug 24 '22 18:08 maazshipra

it is available, with the context preprocessor, you can just use Total price € {{ cart_total_amount|floatformat:2 }} in your template

JensTimmerman avatar Sep 14 '23 09:09 JensTimmerman