vendor/shopware/storefront/Resources/views/storefront/page/checkout/checkout-item.html.twig line 367

Open in your IDE?
  1. {# @deprecated tag:v6.5.0 - Template `checkout-item.html.twig` is deprecated. Use `storefront/component/line-item/line-item.html.twig` instead. #}
  2. {% block page_checkout_item %}
  3.     {# @var page \Shopware\Storefront\Page\Checkout\Cart\CheckoutCartPage #}
  4.     {# @var delivery \Shopware\Core\Checkout\Cart\Delivery\Struct\Delivery #}
  5.     {# @var lineItem \Shopware\Core\Checkout\Cart\LineItem\LineItem #}
  6.     {% set PRODUCT_LINE_ITEM_TYPE = constant('Shopware\\Core\\Checkout\\Cart\\LineItem\\LineItem::PRODUCT_LINE_ITEM_TYPE') %}
  7.     {% set DISCOUNT_LINE_ITEM_TYPE = constant('Shopware\\Core\\Checkout\\Cart\\LineItem\\LineItem::DISCOUNT_LINE_ITEM') %}
  8.     {% set isDiscount = (not lineItem.good and lineItem.price.totalPrice <= 0) || lineItem.type == DISCOUNT_LINE_ITEM_TYPE %}
  9.     {% set isNested = lineItem.children.count > 0 %}
  10.     {# @deprecated tag:v6.5.0 - var will be removed - use 'childrenTemplate' instead #}
  11.     {% set childTemplate = '@Storefront/storefront/page/checkout/checkout-item.html.twig' %}
  12.     {% set childrenTemplate = '@Storefront/storefront/page/checkout/checkout-item-children.html.twig' %}
  13.     {% set deliveryPosition = null %}
  14.     {% if page.cart.deliveries.count > 0 %}
  15.         {% set delivery = page.cart.deliveries.first %}
  16.         {% set deliveryPosition = delivery.positions.get(lineItem.id) %}
  17.     {% endif %}
  18.     {# @deprecated tag:v6.5.0 - `cartItemClasses` & `isChild` will be removed with no replacement #}
  19.     {% set cartItemClasses = '' %}
  20.     {% set label = lineItem.label|trans|sw_sanitize %}
  21.     {% set label = label !== '' ? label : lineItem.label %}
  22.     {% block page_checkout_item_container %}
  23.         <div class="cart-item cart-item-{{ lineItem.type }}{% if isDiscount %} is-discount{% endif %}{{ cartItemClasses }}">
  24.             <div class="row cart-item-row">
  25.                 {% block page_checkout_item_info %}
  26.                     <div class="col-10 col-md-5 cart-item-info">
  27.                         {% block page_checkout_item_info_inner %}
  28.                             <div class="row cart-item-row">
  29.                                 {% block page_checkout_item_info_image %}
  30.                                     <div class="col-auto cart-item-info-img">
  31.                                         {% block page_checkout_item_info_image_container %}
  32.                                             <div class="cart-item-img-container">
  33.                                                 {% block page_checkout_item_info_image_link %}
  34.                                                     {% if isDiscount %}
  35.                                                         <div class="cart-item-img cart-item-discount-icon">
  36.                                                             {% sw_icon 'marketing' style {
  37.                                                                 'color': 'success'
  38.                                                             } %}
  39.                                                         </div>
  40.                                                     {% elseif isNested %}
  41.                                                         <div class="cart-item-nested-icon">
  42.                                                             {% sw_icon 'bag-product' style {
  43.                                                                 'color': 'light'
  44.                                                             } %}
  45.                                                         </div>
  46.                                                     {% else %}
  47.                                                         <a href="{{ seoUrl('frontend.detail.page', {'productId': lineItem.referencedId}) }}"
  48.                                                            class="cart-item-img-link"
  49.                                                            title="{{ label }}"
  50.                                                            {% if controllerAction is same as('confirmPage') %}
  51.                                                                {{ dataBsToggleAttr }}="modal"
  52.                                                                data-modal-class="quickview-modal"
  53.                                                                data-url="{{ path('widgets.quickview.minimal', { 'productId': lineItem.referencedId }) }}"
  54.                                                            {% endif %}
  55.                                                         >
  56.                                                             {% block page_checkout_item_info_image_element %}
  57.                                                                 {% if lineItem.cover.url %}
  58.                                                                     {% sw_thumbnails 'cart-item-img-thumbnails' with {
  59.                                                                         media: lineItem.cover,
  60.                                                                         sizes: {
  61.                                                                             'default': '100px'
  62.                                                                         },
  63.                                                                         attributes: {
  64.                                                                             'class': 'img-fluid cart-item-img',
  65.                                                                             'alt': (lineItem.cover.translated.alt ?: ''),
  66.                                                                             'title': (lineItem.cover.translated.title ?: '')
  67.                                                                         }
  68.                                                                     } %}
  69.                                                                 {% else %}
  70.                                                                     {% sw_icon 'placeholder' style {
  71.                                                                         'size': 'fluid'
  72.                                                                     } %}
  73.                                                                 {% endif %}
  74.                                                             {% endblock %}
  75.                                                         </a>
  76.                                                     {% endif %}
  77.                                                 {% endblock %}
  78.                                             </div>
  79.                                         {% endblock %}
  80.                                     </div>
  81.                                 {% endblock %}
  82.                                 {% block page_checkout_item_info_details %}
  83.                                     <div class="col-12 col-sm-7 col-md-8 cart-item-details">
  84.                                         {% block page_checkout_item_info_details_inner %}
  85.                                             <div class="cart-item-details-container">
  86.                                                 {% block page_checkout_item_info_label %}
  87.                                                     {% if lineItem.type == PRODUCT_LINE_ITEM_TYPE %}
  88.                                                         <a href="{{ seoUrl('frontend.detail.page', {'productId': lineItem.referencedId}) }}"
  89.                                                            class="cart-item-label"
  90.                                                            title="{{ label }}"
  91.                                                            {% if controllerAction is same as('confirmPage') %}
  92.                                                                {{ dataBsToggleAttr }}="modal"
  93.                                                                data-modal-class="quickview-modal"
  94.                                                                data-url="{{ path('widgets.quickview.minimal',{ 'productId': lineItem.referencedId }) }}"
  95.                                                            {% endif %}
  96.                                                         >
  97.                                                             {{ label|u.truncate(60, '...', false)|raw }}
  98.                                                         </a>
  99.                                                     {% else %}
  100.                                                         <div class="cart-item-label">
  101.                                                             {{ label|u.truncate(60, '...', false)|raw }}
  102.                                                         </div>
  103.                                                     {% endif %}
  104.                                                 {% endblock %}
  105.                                                 {% block page_checkout_item_info_variant_characteristics %}
  106.                                                     <div class="cart-item-details-characteristics">
  107.                                                         {% for option in lineItem.payload.options %}
  108.                                                             {{ option.group }}:
  109.                                                             <span class="cart-item-details-characteristics-option">{{ option.option }}</span>
  110.                                                             {% if lineItem.payload.options|last != option %}
  111.                                                                 {{ " | " }}
  112.                                                             {% endif %}
  113.                                                         {% endfor %}
  114.                                                     </div>
  115.                                                 {% endblock %}
  116.                                                 {% block page_checkout_item_info_features %}
  117.                                                     {% if lineItem.type == PRODUCT_LINE_ITEM_TYPE and lineItem.payload.features is not null %}
  118.                                                         {% sw_include '@Storefront/storefront/component/product/feature/list.html.twig' with {
  119.                                                             'features': lineItem.payload.features
  120.                                                         } %}
  121.                                                     {% endif %}
  122.                                                 {% endblock %}
  123.                                                 {% block page_checkout_item_info_ordernumber %}
  124.                                                     {% if lineItem.payload.productNumber %}
  125.                                                         <div class="cart-item-ordernumber">
  126.                                                             {{ "checkout.cartItemInfoId"|trans|sw_sanitize }} {{ lineItem.payload.productNumber }}
  127.                                                         </div>
  128.                                                     {% endif %}
  129.                                                 {% endblock %}
  130.                                                 {% block page_checkout_item_delivery_date %}
  131.                                                     {% if deliveryPosition and deliveryPosition.deliveryDate and config('core.cart.showDeliveryTime') %}
  132.                                                         <div class="cart-item-delivery-date">
  133.                                                             {{ "checkout.lineItemDeliveryDate"|trans({
  134.                                                                 '%earliest%': deliveryPosition.deliveryDate.earliest|format_date('short', locale=app.request.locale),
  135.                                                                 '%latest%': deliveryPosition.deliveryDate.latest|format_date('short', locale=app.request.locale)
  136.                                                             })|sw_sanitize }}
  137.                                                         </div>
  138.                                                     {% endif %}
  139.                                                 {% endblock %}
  140.                                                 {% block page_checkout_item_wishlist %}
  141.                                                     {% if config('core.cart.wishlistEnabled') and lineItem.type == PRODUCT_LINE_ITEM_TYPE %}
  142.                                                         {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  143.                                                             showText: true,
  144.                                                             size: 'sm',
  145.                                                             productId: lineItem.referencedId
  146.                                                         } %}
  147.                                                     {% endif %}
  148.                                                 {% endblock %}
  149.                                             </div>
  150.                                         {% endblock %}
  151.                                     </div>
  152.                                 {% endblock %}
  153.                             </div>
  154.                         {% endblock %}
  155.                     </div>
  156.                 {% endblock %}
  157.                 {% block page_checkout_item_quantity %}
  158.                     <div class="col-12 col-sm-4 col-md-2 cart-item-quantity">
  159.                         <div class="row cart-item-quantity-row">
  160.                             {% block page_checkout_item_quantity_label %}
  161.                                 <div class="col-8 col-sm-12 cart-item-quantity-label">
  162.                                     {{ "checkout.cartHeaderQuantity"|trans|sw_sanitize }}
  163.                                 </div>
  164.                             {% endblock %}
  165.                             {% block page_checkout_item_quantity_select %}
  166.                                 <div class="col-4 col-sm-12">
  167.                                     {% block page_checkout_item_quantity_form %}
  168.                                         {# @deprecated tag:v6.5.0 - 'isChild' will be removed with no replacement #}
  169.                                         {% if lineItem.quantityInformation and lineItem.stackable and not isChild %}
  170.                                             <form action="{{ path('frontend.checkout.line-item.change-quantity', {'id': lineItem.id}) }}"
  171.                                                   class="cart-item-quantity-container"
  172.                                                   method="post"
  173.                                                   data-form-auto-submit="true">
  174.                                                 {% block page_checkout_item_quantity_form_csrf %}
  175.                                                     {{ sw_csrf('frontend.checkout.line-item.change-quantity') }}
  176.                                                 {% endblock %}
  177.                                                 {% block page_checkout_item_quantity_redirect %}
  178.                                                     <input type="hidden"
  179.                                                            name="redirectTo"
  180.                                                            value="frontend.checkout.cart.page">
  181.                                                 {% endblock %}
  182.                                                 {# @var quantityInformation \Shopware\Core\Checkout\Cart\LineItem\QuantityInformation #}
  183.                                                 {% set quantityInformation = lineItem.quantityInformation %}
  184.                                                 {% if quantityInformation.maxPurchase %}
  185.                                                     {% set maxQuantity = quantityInformation.maxPurchase %}
  186.                                                 {% else %}
  187.                                                     {% set maxQuantity = config('core.cart.maxQuantity') %}
  188.                                                 {% endif %}
  189.                                                 {% set selectQuantityThreshold = 100 %}
  190.                                                 {% block page_product_detail_buy_quantity %}
  191.                                                     {% if quantityInformation.maxPurchase /  lineItem.quantityInformation.purchaseSteps > selectQuantityThreshold %}
  192.                                                         {% block page_product_detail_buy_quantity_input %}
  193.                                                             <input
  194.                                                                 type="number"
  195.                                                                 name="quantity"
  196.                                                                 class="form-control js-offcanvas-cart-change-quantity"
  197.                                                                 min="{{ quantityInformation.minPurchase }}"
  198.                                                                 max="{{ maxQuantity }}"
  199.                                                                 step="{{ quantityInformation.purchaseSteps }}"
  200.                                                                 value="{{ lineItem.quantity }}"
  201.                                                             />
  202.                                                         {% endblock %}
  203.                                                     {% else %}
  204.                                                         {% block page_product_detail_buy_quantity_select %}
  205.                                                             <select name="quantity"
  206.                                                                     class="{{ formSelectClass }} quantity-select">
  207.                                                                 {% for quantity in range(lineItem.quantityInformation.minPurchase, maxQuantity, lineItem.quantityInformation.purchaseSteps) %}
  208.                                                                     <option value="{{ quantity }}"
  209.                                                                         {% if quantity == lineItem.quantity %} selected="selected"{% endif %}>
  210.                                                                         {{ quantity }}
  211.                                                                     </option>
  212.                                                                 {% endfor %}
  213.                                                             </select>
  214.                                                         {% endblock %}
  215.                                                     {% endif %}
  216.                                                 {% endblock %}
  217.                                             </form>
  218.                                         {% elseif lineItem.type != "promotion" %}
  219.                                             {% block page_checkout_item_quantity_number %}
  220.                                                 <div class="d-flex justify-content-end cart-item-quantity">
  221.                                                     {{ lineItem.quantity }}
  222.                                                 </div>
  223.                                             {% endblock %}
  224.                                         {% endif %}
  225.                                     {% endblock %}
  226.                                 </div>
  227.                             {% endblock %}
  228.                         </div>
  229.                     </div>
  230.                 {% endblock %}
  231.                 {% block page_checkout_item_unit_price %}
  232.                     <div class="col-12 col-sm-4 col-md-2 cart-item-unit-price">
  233.                         {% block page_checkout_item_unit_price_wrapper %}
  234.                             {% if not isDiscount %}
  235.                                 {% block page_checkout_item_unit_price_label %}
  236.                                     <div class="cart-item-unit-price-label">
  237.                                         {{ "checkout.cartHeaderUnitPrice"|trans|sw_sanitize }}
  238.                                     </div>
  239.                                 {% endblock %}
  240.                                 {% block page_checkout_item_unit_price_inner %}
  241.                                     {{ lineItem.price.unitPrice|currency }}{% block page_checkout_item_unit_price_tax_symbol %}{{ "general.star"|trans|sw_sanitize }}{% endblock %}
  242.                                 {% endblock %}
  243.                             {% endif %}
  244.                         {% endblock %}
  245.                     </div>
  246.                 {% endblock %}
  247.                 {% block page_checkout_item_total_price %}
  248.                     <div class="col-12 col-sm-4 col-md-2 cart-item-total-price">
  249.                         {% block page_checkout_item_total_price_wrapper %}
  250.                             {% block page_checkout_item_total_price_label %}
  251.                                 <div class="cart-item-total-price-label">
  252.                                     {{ "checkout.cartHeaderTotalPrice"|trans|sw_sanitize }}
  253.                                 </div>
  254.                             {% endblock %}
  255.                             {% block page_checkout_item_total_price_inner %}
  256.                                 {# Shipping costs discounts always have a price of 0, which might be confusing, therefore we do not show those #}
  257.                                 {% if lineItem.payload.discountScope != 'delivery' %}
  258.                                     {{ lineItem.price.totalPrice|currency }}{% block page_checkout_item_total_price_tax_symbol %}{{ "general.star"|trans|sw_sanitize }}{% endblock %}
  259.                                 {% endif %}
  260.                             {% endblock %}
  261.                         {% endblock %}
  262.                     </div>
  263.                 {% endblock %}
  264.                 {% block page_checkout_item_remove %}
  265.                     <div class="col-2 col-md-1 cart-item-remove">
  266.                         {% block page_checkout_item_remove_form %}
  267.                             {% if lineItem.removable %}
  268.                                 <form action="{{ path('frontend.checkout.line-item.delete', {'id': lineItem.id}) }}"
  269.                                       method="post"
  270.                                       data-form-csrf-handler="true">
  271.                                     {% block page_checkout_item_remove_form_csrf %}
  272.                                         {{ sw_csrf('frontend.checkout.line-item.delete') }}
  273.                                     {% endblock %}
  274.                                     {% block page_checkout_item_remove_redirect %}
  275.                                         <input type="hidden"
  276.                                                name="redirectTo"
  277.                                                value="frontend.checkout.cart.page">
  278.                                     {% endblock %}
  279.                                     {% block page_checkout_item_remove_submit %}
  280.                                         <button type="submit"
  281.                                                 title="{{ "checkout.removeLineItem"|trans|striptags }}"
  282.                                                 data-product-id="{{ lineItem.id }}"
  283.                                                 class="btn btn-light btn-sm cart-item-remove-button">
  284.                                             {% sw_icon 'x' style { 'size': 'sm' } %}
  285.                                         </button>
  286.                                     {% endblock %}
  287.                                 </form>
  288.                             {% endif %}
  289.                         {% endblock %}
  290.                     </div>
  291.                 {% endblock %}
  292.                 {% block page_checkout_item_children_template %}
  293.                     {% if isNested %}
  294.                         {# @deprecated tag:v6.5.0 - block will be moved to `@Storefront/storefront/page/checkout/checkout-item-children.html.twig` #}
  295.                         {% block page_checkout_item_children %}
  296.                             {% sw_include childrenTemplate %}
  297.                         {% endblock %}
  298.                     {% endif %}
  299.                 {% endblock %}
  300.             </div>
  301.         </div>
  302.     {% endblock %}
  303.     {# @deprecated tag:v6.5.0 - block will be removed #}
  304.     {% block page_checkout_item_child %}{% endblock %}
  305. {% endblock %}