Group identical add-ons in cart (#2500)

Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
Raphael Michel
2022-03-01 15:49:16 +01:00
committed by GitHub
parent a9b0651345
commit b74f5508b7
7 changed files with 29 additions and 12 deletions

View File

@@ -121,8 +121,9 @@
</label>
<div class="col-md-9 form-control-text">
<ul class="addon-list">
{% for a in pos.addons.all %}
<li>{{ a.item.name }}{% if a.variation %} {{ a.variation.value }}{% endif %}</li>
{% regroup pos.addons.all by item_and_variation as addons_by_itemvar %}
{% for group in addons_by_itemvar %}
<li>{% if group.list|length > 1 %}{{ group.list|length }}&times; {% endif %}{{ group.grouper.0.name }}{% if group.grouper.1 %} {{ group.grouper.1.value }}{% endif %}</li>
{% endfor %}
</ul>
</div>

View File

@@ -205,7 +205,7 @@
{% endif %}
</div>
{% elif line.addon_to %}
<div role="cell" class="count">&nbsp;</div>
<div role="cell" class="count">{% if line.count == 1 %}&nbsp;{% else %}{{ line.count }}{% endif %}</div>
<div role="cell" class="singleprice price">
{% if event.settings.display_net_prices %}
{{ line.net_price|money:event.currency }}