{% import "@SyliusShop/Common/Macro/money.html.twig" as money %} {% set tax_included = sylius_order_tax_included(cart) %} {% set tax_excluded = sylius_order_tax_excluded(cart) %} {% set item_class = 'list-style-none d-flex justify-content-between align-items-center py-3 border-top bg-transparent' %} {% set current_route = app.request is defined and app.request ? app.request.attributes.get('_route') : null %} {% set hide_shipping_on_route = current_route in ['sylius_shop_cart_summary', 'sylius_shop_checkout_address'] %} {% set has_selected_shipping = false %} {% for shipment in cart.shipments %} {% if shipment.method is not null %} {% set has_selected_shipping = true %} {% endif %} {% endfor %} {% set display_shipping = has_selected_shipping and not hide_shipping_on_route %} {% set display_total = display_shipping ? cart.total : cart.total - cart.shippingTotal %} {% set order_promotion_adjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT') %} {% set order_item_promotion_adjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT') %} {% set order_unit_promotion_adjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT') %} {% set promotion_coupon = cart.promotionCoupon %} {% set promotion_coupon_code = promotion_coupon and promotion_coupon.promotion ? promotion_coupon.promotion.code : null %} {% set volume_discount_total = 0 %} {% set coupon_discount_total = 0 %} {% for adjustment_type in [order_promotion_adjustment, order_item_promotion_adjustment, order_unit_promotion_adjustment] %} {% for adjustment in cart.getAdjustmentsRecursively(adjustment_type) %} {% set amount = adjustment.amount %} {% if promotion_coupon_code and adjustment.originCode == promotion_coupon_code %} {% set coupon_discount_total = coupon_discount_total + amount %} {% else %} {% set volume_discount_total = volume_discount_total + amount %} {% endif %} {% endfor %} {% endfor %} {% set original_items_total = 0 %} {% for item in cart.items %} {% set original_items_total = original_items_total + (item.quantity * item.unitPrice) %} {% endfor %} {% set items_total = original_items_total ?: (display_total - volume_discount_total - coupon_discount_total) %} {% set order_promotion_percentage = null %} {% if volume_discount_total and original_items_total %} {% set order_promotion_percentage = ((volume_discount_total / original_items_total) * 100)|abs %} {% endif %}

{{ 'sylius.ui.summary'|trans }}

{{ sylius_template_event('sylius.shop.cart.summary.totals', {'cart': cart}) }}