mirror of
https://github.com/Crocmagnon/checkout.git
synced 2024-11-22 08:08:04 +01:00
Fix article count on basket list
This commit is contained in:
parent
3eb55181eb
commit
99b74c9262
2 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{% blocktranslate with basket_id=basket.id %}Basket #{{ basket_id }}{% endblocktranslate %}</h5>
|
<h5 class="card-title">{% blocktranslate with basket_id=basket.id %}Basket #{{ basket_id }}{% endblocktranslate %}</h5>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
{% blocktranslate count counter=basket.items.count %}1 item{% plural %}{{ counter }} items{% endblocktranslate %}<br>
|
{% blocktranslate count counter=basket.articles_count %}1 item{% plural %}{{ counter }} items{% endblocktranslate %}<br>
|
||||||
{{ basket.price|currency }}<br>
|
{{ basket.price|currency }}<br>
|
||||||
{{ basket.payment_method|default:"-" }}<br>
|
{{ basket.payment_method|default:"-" }}<br>
|
||||||
{% now "Y-m-d" as todays_date %}
|
{% now "Y-m-d" as todays_date %}
|
||||||
|
|
|
@ -101,7 +101,7 @@ def additional_unpriced_product(request: WSGIRequest) -> HttpResponse:
|
||||||
@permission_required("purchase.view_basket")
|
@permission_required("purchase.view_basket")
|
||||||
@condition(etag_func=reports_etag, last_modified_func=reports_last_modified)
|
@condition(etag_func=reports_etag, last_modified_func=reports_last_modified)
|
||||||
def list_baskets(request: WSGIRequest) -> HttpResponse:
|
def list_baskets(request: WSGIRequest) -> HttpResponse:
|
||||||
context = {"baskets": Basket.objects.priced().order_by("-id")}
|
context = {"baskets": Basket.objects.with_articles_count().priced().order_by("-id")}
|
||||||
return render(request, "purchase/basket_list.html", context)
|
return render(request, "purchase/basket_list.html", context)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue