Add itemcount (Items, excluding AddOns) to fragment_cart (#1514)

* Add itemcount (Items, excluding AddOns) to fragment_cart

* Simplify itemcount
This commit is contained in:
Martin Gross
2019-12-05 16:45:41 +01:00
committed by Raphael Michel
parent 090d5bfe94
commit e4582dd9ed
2 changed files with 7 additions and 3 deletions

View File

@@ -243,11 +243,14 @@
</div>
{% endif %}
<div class="row cart-row total">
<div class="col-md-4 col-xs-6">
<div class="product">
<strong>{% trans "Total" %}</strong>
</div>
<div class="col-md-3 col-xs-6 col-md-offset-5 price">
<div class="count hidden-xs">
<strong>{{ cart.itemcount }}</strong>
</div>
<div class="col-md-3 col-xs-6 col-md-offset-3 price">
<strong>{{ cart.total|money:event.currency }}</strong>
</div>
<div class="clearfix"></div>
</div>
</div>

View File

@@ -173,6 +173,7 @@ class CartMixin:
'minutes_left': minutes_left,
'seconds_left': seconds_left,
'first_expiry': first_expiry,
'itemcount': sum(c.count for c in positions if not c.addon_to)
}