<div class="cart-preview">
<h3>{% trans %}prehled.objednavky{% endtrans %}</h3>
<hr class="cart-preview__divider">
{% if order %}
{% set alreadyPrinted = [] %}
{% for product_variant in order.productVariants %}
{% set productVariant = product_variant.productVariant %}
{% if productVariant.id not in alreadyPrinted %}
<div class="cart-preview__product">
<div class="cart-preview__product-img">
{% if productVariant.productVariantUploadGroups|length > 0 and productVariant.productVariantUploadGroups[0].UploadGroup.upload|length > 0 %}
<img alt="Foto produktu" src="{{ asset(productVariant.productVariantUploadGroups[0].UploadGroup.upload[0].path) }}">
{% else %}
<img src="{{ asset('build/img/mua-no-photo.jpg') }}" alt="Foto produktu">
{% endif %}
</div>
<div class="cart-preview__product-info">
<a class="cart-preview__product-title" href="{{ path('shop_product', {slug:productVariant.product.slug}) }}">
<p class="cart-preview__product-title">{{ productVariant.name == productVariant.product.name ? productVariant.product.name : productVariant.product.name ~ ' - ' ~ productVariant.name}}</p>
</a>
<div class="cart-preview__product-count">{{ product_variant_occurrences[productVariant.id] }}x</div>
<div class="cart-preview__product-price">
<div class="cart-preview__product-price-final"> {{ (calculate_product_variant_price(productVariant, app.session.get("selectedCurrency"), "withVat", "withDiscount", 0) * product_variant_occurrences[productVariant.id])|round(0) }} {% trans %}mena{% endtrans %}</div>
{% if calculate_product_variant_price(product_variant, app.session.get("selectedCurrency"), "withVat", "withDiscount", 0) < calculate_product_variant_price(product_variant, app.session.get("selectedCurrency"), "withVat", "withoutDiscount", 0) %}
<span class="cart-preview__product-price-before">{{ (calculate_product_variant_price(product_variant, app.session.get("selectedCurrency"), "withVat", "withoutDiscount", 0) * product_variant_occurrences[productVariant.id])|round(0) }} {% trans %}mena{% endtrans %}</span>
<span class="cart-preview__product-price-sale">-{{ get_discount_amount(product_variant, 'percentage')|round(0, 'ceil') }}%</span>
{% endif %}
</div>
</div>
</div>
{% set alreadyPrinted = alreadyPrinted|merge([productVariant.id]) %}
{% endif %}
{% endfor %}
{% if order.transportation or order.PaymentType %}
<hr class="cart-preview__divider">
<div class="cart-preview__shipping">
{% if order.transportation %}
<h5 class="cart-preview__subheading">{% trans %}doprava{% endtrans %}</h5>
<div class="cart-preview__shipping-type">{{ order.transportation.name }}</div>
<div class="cart-preview__shipping-price {% if transportation_price(order, "withVat", app.session.get("selectedCurrency")) == 0 %} cart-preview__shipping-price--free{% else %}cart-preview__shipping-price {% endif %}">
{% if transportation_price(order, "withVat", app.session.get("selectedCurrency")) == 0%} {% trans %}zdarma{% endtrans %}
{% else %}{{ transportation_price(order, "withVat", app.session.get("selectedCurrency")) }} {% trans %}mena{% endtrans %}{% endif %}
</div>
{% endif %}
{% if order.paymentType %}
<h5 class="cart-preview__subheading mt-5">{% trans %}platba{% endtrans %}</h5>
<div class="cart-preview__shipping-type">{{ order.paymentType.name }}</div>
<div class="cart-preview__shipping-price {% if payment_price(order, "withVat", app.session.get("selectedCurrency")) == 0 %} cart-preview__shipping-price--free{% else %}cart-preview__shipping-price {% endif %}">
{% if payment_price(order, "withVat", app.session.get("selectedCurrency")) == 0 %} {% trans %}zdarma{% endtrans %}
{% else %}{{ payment_price(order, "withVat", app.session.get("selectedCurrency")) }} {% trans %}mena{% endtrans %} {% endif %}
</div>
{% endif %}
</div>
{% endif %}
<hr class="cart-preview__divider">
<div class="cart-preview__total">
<span>{% trans %}celkem.uhrade{% endtrans %} </span>
<div class="cart-preview__total-price">{{ calculate_purchase_price(order, app.session.get("selectedCurrency"),"withVat", null, "withDiscount", 1)|round(0) }} {% trans %}mena{% endtrans %}</div>
</div>
{% else %}
<div class="cart-preview__total">
<span>{% trans %}kosik.prazdny{% endtrans %}</span>
</div>
{% endif %}
</div>
<p class="cart-preview-text">{% trans %}nevitesirady.volejte{% endtrans %}</p>
<a href="tel:+420286010545" class="cart-preview-link">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.4993 18.3328C11.0971 18.3284 7.83544 16.9749 5.42968 14.5691C3.02392 12.1633 1.67043 8.9017 1.66602 5.49944C1.66602 4.48278 2.06988 3.50776 2.78877 2.78887C3.50766 2.06998 4.48269 1.66611 5.49935 1.66611C5.71463 1.66447 5.92956 1.68401 6.14102 1.72444C6.34544 1.75469 6.5464 1.80494 6.74102 1.87444C6.87789 1.92247 6.99986 2.00539 7.09486 2.115C7.18986 2.22462 7.2546 2.35713 7.28268 2.49944L8.42435 7.49944C8.45512 7.63516 8.45142 7.77643 8.41357 7.91035C8.37572 8.04427 8.30494 8.16657 8.20768 8.26611C8.09935 8.38278 8.09102 8.39111 7.06602 8.92444C7.88684 10.7252 9.32702 12.1712 11.1243 12.9994C11.666 11.9661 11.6743 11.9578 11.791 11.8494C11.8906 11.7522 12.0129 11.6814 12.1468 11.6436C12.2807 11.6057 12.422 11.602 12.5577 11.6328L17.5577 12.7744C17.6954 12.8064 17.8228 12.8729 17.9278 12.9677C18.0327 13.0624 18.1118 13.1823 18.1577 13.3161C18.228 13.5139 18.281 13.7175 18.316 13.9244C18.3496 14.1339 18.3663 14.3457 18.366 14.5578C18.3506 15.5701 17.9354 16.5352 17.211 17.2425C16.4866 17.9497 15.5117 18.3417 14.4993 18.3328V18.3328ZM5.49935 3.33278C4.92539 3.33497 4.37556 3.56395 3.96971 3.9698C3.56386 4.37566 3.33488 4.92548 3.33268 5.49944C3.33489 8.46035 4.51208 11.2994 6.60576 13.393C8.69944 15.4867 11.5384 16.6639 14.4993 16.6661C15.0733 16.6639 15.6231 16.4349 16.029 16.0291C16.4348 15.6232 16.6638 15.0734 16.666 14.4994V14.2244L12.7993 13.3328L12.5577 13.7911C12.1827 14.5161 11.9077 15.0411 11.2077 14.7578C9.82675 14.2635 8.57326 13.4678 7.53829 12.4285C6.50333 11.3892 5.71287 10.1324 5.22435 8.74944C4.92435 8.09944 5.49102 7.79944 6.20768 7.42444L6.66602 7.19944L5.77435 3.33278H5.49935Z" fill="black"/>
</svg>
+420 286 010 545
</a>