card drawer show amount for free delivery

main
alexanderroese 2024-06-18 22:31:58 +02:00
parent c5976a8de1
commit f0a37a7f13
1 changed files with 10 additions and 2 deletions

View File

@ -72,10 +72,18 @@
</div>
<script>
console.log("cart1", {{ cart | json }})
console.log("cart2", {{ cart | json }})
</script>
<span>price5 {{ cart.total_price | money }} {% render 'shx-shipping-costs' %}</span>
{% assign free_shipping_threshold = {% render 'shx-shipping-costs' %} %}
{% assign total_price = cart.total_price %}
{% assign remaining_amount = free_shipping_threshold | minus: total_price %}
<span>price5 {{ total_price | money }} {% render 'shx-shipping-costs' %}</span>
{% if total_price < free_shipping_threshold %}
<span>Du bist nur noch {{ remaining_amount | money }} von kostenfreiem Versand entfernt!</span>
{% endif %}
<cart-drawer-items
{% if cart == empty %}