{% sw_extends '@Storefront/storefront/base.html.twig' %}
{% block base_flashbags %}{% endblock %}
{% block base_content %}
{% block page_checkout %}
<div class="checkout">
{% block page_checkout_container %}
<div class="checkout-container">
{% block page_checkout_main %}
<div class="checkout-main">
{% block base_flashbags_checkout %}
<div class="flashbags">
{% for type, messages in app.flashes %}
{% sw_include '@Storefront/storefront/utilities/alert.html.twig' with { type: type, list: messages } %}
{% endfor %}
</div>
{% endblock %}
{% block page_checkout_main_content %}{% endblock %}
</div>
{% endblock %}
{% block page_checkout_additional %}{% endblock %}
{% block page_checkout_aside %}
<div class="checkout-aside {% if block('page_checkout_additional')|trim %}checkout-aside-no-offset{% endif %}">
{% block page_checkout_aside_container %}
<div class="checkout-aside-container">
{% block page_checkout_aside_summary %}
<div class="checkout-aside-summary">
{% block page_checkout_summary_header %}
{% if context.customer.customFields.lenz_customer_discount_customer_discount_percent and context.customer.customFields.lenz_customer_discount_customer_discount_percent > 0 %}
<div role="alert" class="alert alert-success">
<div class="alert-content-container">
<div class="alert-content">
{% set sum = 0 %}
{% for item in page.cart.lineitems %}
{% if item.type === 'product' %}
{% set sum = (sum + item.price.totalPrice)|round('2', 'floor') %}
{%endif %}
{% endfor %}
{%set sum = (sum/(100.0-context.customer.customFields.lenz_customer_discount_customer_discount_percent) * 100) %}
{% set sum = sum / 100 * context.customer.customFields.lenz_customer_discount_customer_discount_percent %}
Ihr Rabatt in Höhe
von {{ context.customer.customFields.lenz_customer_discount_customer_discount_percent }} % ({{ sum|currency }})
wurde bereits berücksichtigt.
</div>
</div>
</div>
{% endif %}
<h2 class="checkout-aside-summary-header">
{{ "checkout.summaryHeader"|trans|sw_sanitize }}
</h2>
{% endblock %}
{% block page_checkout_summary_list %}
<div class="checkout-aside-summary-list-container">
{% block page_checkout_summary_list_container %}
{% sw_include '@Storefront/storefront/page/checkout/summary.html.twig' %}
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
{% block page_checkout_aside_actions %}{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
{% endblock %}