{# @deprecated tag:v6.5.0 - Template `checkout-item.html.twig` is deprecated. Use `storefront/component/line-item/line-item.html.twig` instead. #}
{% block page_checkout_item %}
{% set PRODUCT_LINE_ITEM_TYPE = constant('Shopware\\Core\\Checkout\\Cart\\LineItem\\LineItem::PRODUCT_LINE_ITEM_TYPE') %}
{% set deliveryPosition = null %}
{% if page.cart.deliveries.count > 0 %}
{% set delivery = page.cart.deliveries.first %}
{% set deliveryPosition = delivery.positions.get(lineItem.id) %}
{% endif %}
{% set label = lineItem.label %}
{% set appliedDiscount = lineItem.extensions.fourtwosixThemeExtension.appliedDiscount %}
{% block page_checkout_item_container %}
<div class="cart-item cart-item-{{ lineItem.type }} fourtwosix-qm-unit" data-buybyqmunit-plugin="true">
<div class="row cart-item-row">
{{ block("page_checkout_item_info", "@Storefront/storefront/page/checkout/checkout-item.html.twig") }}
{% if controllerAction != "finishPage" %}
<div class="col-12 col-sm-8 col-md-4 cart-item-quantity">
{% if lineItem.quantityInformation and lineItem.stackable and not isChild %}
<form action="{{ path('frontend.checkout.line-item.change-quantity', {'id': lineItem.id}) }}"
class="cart-item-quantity-container cartForm"
method="post"
data-form-auto-submit="true">
{{ sw_csrf('frontend.checkout.line-item.change-quantity') }}
{% if activeRoute == "frontend.checkout.cart.page" %}
<input type="hidden" name="redirectTo" value="frontend.checkout.cart.page">
{% elseif activeRoute == "frontend.checkout.confirm.page" %}
<input type="hidden" name="redirectTo" value="frontend.checkout.confirm.page">
{% endif %}
{% set quantityUnit = page.cart.data.elements["product-"~ lineItem.id].purchaseUnit %}
{% set quantityPack = page.cart.data.elements["product-"~ lineItem.id].referenceUnit %}
{% set minPurchase = page.cart.data.elements["product-"~ lineItem.id].minPurchase %}
{% set purchaseSteps = page.cart.data.elements["product-"~ lineItem.id].purchaseSteps %}
{% set availableStock = lineItem.payload.isCloseout ? lineItem.quantityInformation.maxPurchase : config('core.cart.maxQuantity') %}
{% sw_include '@Storefront/storefront/component/product/card/price-qm-unit.html.twig' with {
'isCloseout': lineItem.payload.isCloseout,
'stock': availableStock,
'priceUnit': lineItem.price.unitPrice,
'sellingUnit': quantityUnit * lineItem.quantity,
'packUnit': lineItem.quantity,
'quantityInputName': "quantity",
'quantityInputClasses': 'quantity-select',
'translatedUnitName' : lineItem.price.referencePrice.unitName,
'minPurchase': minPurchase,
"purchaseSteps": purchaseSteps,
"sellingStep": quantityUnit * lineItem.quantity,
} %}
</form>
{% endif %}
</div>
{% else %}
<div class="col-12 col-sm-2 col-md-2 cart-item-quantity justify-content-end">
<div>
<div class="font-weight-bold">
{{ lineItem.price.referencePrice.unitName }}
</div>
{{ lineItem.price.referencePrice.purchaseUnit * lineItem.quantity }}
</div>
</div>
<div class="col-12 col-sm-2 col-md-2 cart-item-quantity justify-content-end">
<div>
<div class="font-weight-bold">
{{ "checkout.cartHeaderQuantity"|trans|sw_sanitize }}
</div>
{{ lineItem.quantity }}
</div>
</div>
{% endif %}
{% block page_checkout_item_total_price_qm %}
<div class="col-12 col-sm-4 col-md-2 cart-item-price text-right">
<div class="cart-item-unit-price">
<div class="cart-item-unit-price-label font-weight-bold">
{{ "checkout.cartHeaderUnitPrice"|trans|sw_sanitize }}
</div>
<div>
{% if appliedDiscount %}
{% set discountProQuantity = (appliedDiscount / lineItem.quantity) %}
<div class="font-weight-bold">
<span class="text-decoration-line-through">
{{ lineItem.price.totalPrice|currency }}
</span>
<span class="text-danger">
{{ (lineItem.price.unitPrice - discountProQuantity)|currency }}
</span>
</div>
<div>
({{ (lineItem.price.referencePrice.price -
(discountProQuantity / lineItem.price.referencePrice.purchaseUnit)
)|currency }}/{{ lineItem.price.referencePrice.referenceUnit }}{{ lineItem.price.referencePrice.unitName }})
</div>
{% else %}
<span>
{{ lineItem.price.unitPrice|currency }}
</span>
<div>
({{ lineItem.price.referencePrice.price|currency }}/{{ lineItem.price.referencePrice.referenceUnit }}{{ lineItem.price.referencePrice.unitName }})
</div>
{% endif %}
</div>
</div>
<div class="cart-item-unit-price mt-md-2">
<div class="cart-item-total-price-label fts-qm">
{{ "checkout.cartHeaderTotalPrice"|trans|sw_sanitize }}
</div>
<div class="font-weight-bold totalPrice {% if appliedDiscount %}text-danger{% endif %}">
{{ (lineItem.price.totalPrice - appliedDiscount)|currency }}
{{ "general.star"|trans|sw_sanitize }}
</div>
</div>
</div>
{% endblock %}
{% if controllerAction != "finishPage" %}
{{ block("page_checkout_item_remove", "@Storefront/storefront/page/checkout/checkout-item.html.twig") }}
{% endif %}
</div>
</div>
{% endblock %}
{% endblock %}