{% sw_extends '@Storefront/storefront/page/checkout/summary.html.twig' %} {% block page_checkout_summary_inner %} {% set sellopsUpsellDiscountTotal = 0 %} {% set sellopsUpsellDiscountPercent = null %} {% for li in summary.lineItems %} {% if li.type == 'sellops_upsell_discount' and li.price is not null %} {% set sellopsUpsellDiscountTotal = sellopsUpsellDiscountTotal + li.price.totalPrice %} {% if sellopsUpsellDiscountPercent is null %} {% set sellopsUpsellDiscountPercent = li.payload.sellopsUpsellDiscountPercent ?? null %} {% endif %} {% endif %} {% endfor %} {% set ucMilestoneInfo = page.extensions.ucMilestoneInfo ?? null %} {% set ucDiscountItems = ucMilestoneInfo.discountItems ?? [] %} {% set ucFreeShippingApplied = ucMilestoneInfo.freeShippingApplied ?? false %} {% set ucDiscountTotal = 0 %} {% for item in ucDiscountItems %} {% set ucDiscountTotal = ucDiscountTotal + item.totalPrice %} {% endfor %} {% if sellopsUpsellDiscountTotal == 0 and ucDiscountTotal == 0 and not ucFreeShippingApplied %} {{ parent() }} {% else %} {% set sellopsShippingTotal = 0 %} {% for delivery in summary.deliveries %} {% set sellopsShippingTotal = sellopsShippingTotal + (delivery.shippingCosts.totalPrice ?? 0) %} {% endfor %} {% set sellopsItemsSubtotal = summary.price.positionPrice - sellopsUpsellDiscountTotal - ucDiscountTotal %}
{{ 'checkout.subtotalAmount'|trans|sw_sanitize }}
{{ sellopsItemsSubtotal|currency }}
{% for item in ucDiscountItems %}
★ {{ item.label|sw_sanitize }}
{{ item.totalPrice|currency }}
{% endfor %}
{{ 'checkout.summaryShipping'|trans|sw_sanitize }}
{% if ucFreeShippingApplied %}
✓ Free
{% else %}
{{ sellopsShippingTotal|currency }}
{% endif %} {% if sellopsUpsellDiscountTotal != 0 %} {% set discountPercent = sellopsUpsellDiscountPercent ?? config('SellopsPostPurchaseUpsell.config.interstitialDiscountPercent') %}
Upsell discount{% if discountPercent %} ({{ discountPercent }}%){% endif %}
{{ sellopsUpsellDiscountTotal|currency }}
{% endif %}
{{ 'checkout.summaryTotalPrice'|trans|sw_sanitize }}
{{ summary.price.totalPrice|currency(decimals=context.totalRounding.decimals) }}
{% if summary.price.taxStatus == 'gross' %} {% sw_include '@Storefront/storefront/page/checkout/summary/summary-net.html.twig' with { summary: summary } %} {% sw_include '@Storefront/storefront/page/checkout/summary/summary-tax.html.twig' with { summary: summary } %} {% else %} {% sw_include '@Storefront/storefront/page/checkout/summary/summary-net.html.twig' with { summary: summary } %} {% sw_include '@Storefront/storefront/page/checkout/summary/summary-tax.html.twig' with { summary: summary } %} {% endif %} {% endif %} {% endblock %}