vendor/shopware/storefront/Resources/views/storefront/page/checkout/cart/index.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/checkout/_page.html.twig' %}
  2. {% block base_head %}
  3.     {% sw_include '@Storefront/storefront/page/checkout/cart/meta.html.twig' %}
  4. {% endblock %}
  5. {% block page_checkout_container %}
  6.     {% if page.cart.lineItems.count is same as(0) %}
  7.         {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  8.             type: "info",
  9.             content: "checkout.cartEmpty"|trans|sw_sanitize
  10.         } %}
  11.         {% set messages = app.flashes %}
  12.         {% if messages.danger|length > 0 %}
  13.             <div class="flashbags">
  14.                 {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with { type: 'danger', list: messages.danger } %}
  15.             </div>
  16.         {% endif %}
  17.     {% else %}
  18.         {{ parent() }}
  19.     {% endif %}
  20. {% endblock %}
  21. {% block page_checkout_main_content %}
  22.     {% block page_checkout_cart %}
  23.         {% block page_checkout_cart_header %}
  24.             <h1 class="cart-main-header">
  25.                 {{ "checkout.cartHeader"|trans|sw_sanitize }}
  26.             </h1>
  27.         {% endblock %}
  28.         {% block page_checkout_cart_product_table %}
  29.             <div class="card checkout-product-table">
  30.                 <div class="card-body">
  31.                     {% block page_checkout_cart_table_header %}
  32.                         {# @deprecated tag:v6.5.0 - Template `cart-product-header.html.twig` is deprecated. Use `storefront/component/checkout/cart-header.html.twig` instead. #}
  33.                         {% if feature('v6.5.0.0') %}
  34.                             {% sw_include '@Storefront/storefront/component/checkout/cart-header.html.twig' %}
  35.                         {% else %}
  36.                             {% sw_include '@Storefront/storefront/page/checkout/cart/cart-product-header.html.twig' %}
  37.                         {% endif %}
  38.                     {% endblock %}
  39.                     {% block page_checkout_cart_table_items %}
  40.                         {% for lineItem in page.cart.lineItems %}
  41.                             {% block page_checkout_cart_table_item %}
  42.                                 {% block page_checkout_item %}
  43.                                     {# @deprecated tag:v6.5.0 - Template `checkout-item.html.twig` is deprecated. Use `storefront/component/line-item/line-item.html.twig` instead. #}
  44.                                     {% if feature('v6.5.0.0') %}
  45.                                         {% sw_include '@Storefront/storefront/component/line-item/line-item.html.twig' %}
  46.                                     {% else %}
  47.                                         {% sw_include '@Storefront/storefront/page/checkout/checkout-item.html.twig' %}
  48.                                     {% endif %}
  49.                                 {% endblock %}
  50.                             {% endblock %}
  51.                         {% endfor %}
  52.                     {% endblock %}
  53.                 </div>
  54.             </div>
  55.         {% endblock %}
  56.         {% block page_checkout_cart_hidden_line_items_information %}
  57.             {% sw_include '@Storefront/storefront/component/checkout/hidden-line-items-information.html.twig' with {
  58.                 cart: page.cart,
  59.                 lineItems: page.cart.lineItems
  60.             } %}
  61.         {% endblock %}
  62.         {% block page_checkout_cart_add_product_and_shipping %}
  63.             <div class="row">
  64.                 {% block page_checkout_cart_add_product %}
  65.                     <div class="col-md-4 cart-add-product-container">
  66.                         <form action="{{ path('frontend.checkout.product.add-by-number') }}"
  67.                               data-form-csrf-handler="true"
  68.                               class="cart-add-product"
  69.                               method="post">
  70.                             {# @deprecated tag:v6.5.0 - Block page_checkout_cart_add_product_csrf will be removed. #}
  71.                             {% block page_checkout_cart_add_product_csrf %}
  72.                                 {{ sw_csrf('frontend.checkout.product.add-by-number') }}
  73.                             {% endblock %}
  74.                             {% block page_checkout_cart_add_product_redirect %}
  75.                                 <input type="hidden"
  76.                                        name="redirectTo"
  77.                                        value="frontend.checkout.cart.page">
  78.                             {% endblock %}
  79.                             {% block page_checkout_cart_add_product_input_group %}
  80.                                 <div class="input-group">
  81.                                     {% block page_checkout_cart_add_product_label %}
  82.                                         <label class="{{ visuallyHiddenClass }}" for="addProductInput">
  83.                                             {{ "checkout.addProductLabel"|trans|sw_sanitize }}
  84.                                         </label>
  85.                                     {% endblock %}
  86.                                     {% block page_checkout_cart_add_product_input %}
  87.                                         <input type="text"
  88.                                                name="number"
  89.                                                class="form-control"
  90.                                                id="addProductInput"
  91.                                                placeholder="{{ "checkout.addProductPlaceholder"|trans|striptags }}"
  92.                                                aria-label="{{ "checkout.addProductLabel"|trans|striptags }}"
  93.                                                aria-describedby="addProductButton"
  94.                                                required="required">
  95.                                     {% endblock %}
  96.                                     {% block page_checkout_cart_add_product_submit %}
  97.                                         {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `input-group-append` wrapper and uses elements as direct childs of `input-group` #}
  98.                                         {% if feature('v6.5.0.0') %}
  99.                                             <button class="btn btn-secondary"
  100.                                                     type="submit"
  101.                                                     id="addProductButton">
  102.                                                 {% sw_icon 'checkmark' %}
  103.                                             </button>
  104.                                         {% else %}
  105.                                             <div class="input-group-append">
  106.                                                 <button class="btn btn-secondary"
  107.                                                         type="submit"
  108.                                                         id="addProductButton">
  109.                                                     {% sw_icon 'checkmark' %}
  110.                                                 </button>
  111.                                             </div>
  112.                                         {% endif %}
  113.                                     {% endblock %}
  114.                                 </div>
  115.                             {% endblock %}
  116.                         </form>
  117.                     </div>
  118.                 {% endblock %}
  119.                 {% block page_checkout_cart_shipping_costs %}
  120.                     <div class="col-md-8 cart-shipping-costs-container">
  121.                         <form name="precalc"
  122.                               method="post"
  123.                               action="{{ path('frontend.checkout.configure') }}"
  124.                               data-form-auto-submit="true">
  125.                             {# @deprecated tag:v6.5.0 - Block page_checkout_cart_shipping_costs_csrf will be removed. #}
  126.                             {% block page_checkout_cart_shipping_costs_csrf %}
  127.                                 {{ sw_csrf('frontend.checkout.configure') }}
  128.                             {% endblock %}
  129.                             {% block page_checkout_cart_shipping_costs_trigger %}
  130.                                 <a class="btn btn-link cart-shipping-costs-btn"
  131.                                    {{ dataBsToggleAttr }}="collapse"
  132.                                    href="#collapseShippingCost"
  133.                                    role="button"
  134.                                    aria-expanded="false"
  135.                                    aria-controls="collapseExample">
  136.                                     {{ "checkout.shippingCosts"|trans|sw_sanitize }}
  137.                                     {% block page_checkout_cart_shipping_costs_trigger_icon %}
  138.                                         {% sw_icon 'arrow-medium-right' style { 'pack':'solid', 'size': 'sm' } %}
  139.                                     {% endblock %}
  140.                                 </a>
  141.                             {% endblock %}
  142.                             {% block page_checkout_cart_shipping_costs_form_group %}
  143.                                 <div class="collapse" id="collapseShippingCost">
  144.                                     {% block page_checkout_cart_shipping_costs_form_group_country %}
  145.                                         {% if not context.customer %}
  146.                                             <div class="form-group">
  147.                                                 <label for="countryId">{{ "checkout.shippingCountry"|trans|sw_sanitize }}</label>
  148.                                                 <select class="{{ formSelectClass }}" type="text" id="countryId" name="countryId">
  149.                                                     {% for country in page.countries %}
  150.                                                         <option value="{{ country.id }}"
  151.                                                             {{ country.id == context.shippingLocation.country.id ? 'selected="selected"' : '' }}>
  152.                                                             {{ country.translated.name }}
  153.                                                         </option>
  154.                                                     {% endfor %}
  155.                                                 </select>
  156.                                             </div>
  157.                                         {% endif %}
  158.                                     {% endblock %}
  159.                                     {% block page_checkout_cart_shipping_costs_form_group_payment_method %}
  160.                                         <div class="form-group">
  161.                                             <label for="paymentMethodId">{{ "checkout.paymentMethod"|trans|sw_sanitize }}</label>
  162.                                             <select class="{{ formSelectClass }}" type="text" id="paymentMethodId" name="paymentMethodId">
  163.                                                 {% if context.paymentMethod.id not in page.paymentMethods.ids %}
  164.                                                     <option value="{{ context.paymentMethod.id }}"
  165.                                                             selected="selected"
  166.                                                             disabled="disabled">
  167.                                                         {{ context.paymentMethod.translated.name }} {{ "checkout.notAvailableSuffix"|trans|sw_sanitize }}
  168.                                                     </option>
  169.                                                 {% endif %}
  170.                                                 {% for payment in page.paymentMethods %}
  171.                                                     <option value="{{ payment.id }}"
  172.                                                         {% if payment.id == context.paymentMethod.id %} selected="selected"{% endif %}>
  173.                                                         {{ payment.translated.name }}
  174.                                                     </option>
  175.                                                 {% endfor %}
  176.                                             </select>
  177.                                         </div>
  178.                                     {% endblock %}
  179.                                     {% block page_checkout_cart_shipping_costs_form_group_shipping_method %}
  180.                                         <div class="form-group">
  181.                                             <label for="shippingMethodId">{{ "checkout.shippingMethod"|trans|sw_sanitize }}</label>
  182.                                             <select class="{{ formSelectClass }}" type="text" id="shippingMethodId" name="shippingMethodId">
  183.                                                 {% if context.shippingMethod.id not in page.shippingMethods.ids %}
  184.                                                     <option value="{{ context.shippingMethod.id }}"
  185.                                                             selected="selected"
  186.                                                             disabled="disabled">
  187.                                                         {{ context.shippingMethod.translated.name }} {{ "checkout.notAvailableSuffix"|trans|sw_sanitize }}
  188.                                                     </option>
  189.                                                 {% endif %}
  190.                                                 {% for shipping in page.shippingMethods %}
  191.                                                     <option value="{{ shipping.id }}"
  192.                                                         {% if shipping.id == context.shippingMethod.id %} selected="selected"{% endif %}>
  193.                                                         {{ shipping.translated.name }}
  194.                                                     </option>
  195.                                                 {% endfor %}
  196.                                             </select>
  197.                                         </div>
  198.                                     {% endblock %}
  199.                                     <input type="hidden" name="redirectTo" value="frontend.checkout.cart.page">
  200.                                 </div>
  201.                             {% endblock %}
  202.                         </form>
  203.                     </div>
  204.                 {% endblock %}
  205.             </div>
  206.         {% endblock %}
  207.     {% endblock %}
  208. {% endblock %}
  209. {% block page_checkout_aside_actions %}
  210.     <div class="checkout-aside-action">
  211.         {% block page_checkout_cart_add_promotion %}
  212.             <form action="{{ path('frontend.checkout.promotion.add') }}"
  213.                   class="cart-add-promotion"
  214.                   data-form-csrf-handler="true"
  215.                   method="post">
  216.                 {# @deprecated tag:v6.5.0 - Block page_checkout_cart_add_promotion_csrf will be removed. #}
  217.                 {% block page_checkout_cart_add_promotion_csrf %}
  218.                     {{ sw_csrf('frontend.checkout.promotion.add') }}
  219.                 {% endblock %}
  220.                 {% block page_checkout_cart_add_promotion_forward %}
  221.                     <input type="hidden"
  222.                            name="redirectTo"
  223.                            value="frontend.checkout.cart.page">
  224.                 {% endblock %}
  225.                 {% block page_checkout_cart_add_promotion_input_group %}
  226.                     <div class="input-group checkout-aside-add-code">
  227.                         {% block page_checkout_cart_add_promotion_label %}
  228.                             <label class="{{ visuallyHiddenClass }}" for="addPromotionInput">
  229.                                 {{ "checkout.addPromotionLabel"|trans|sw_sanitize }}
  230.                             </label>
  231.                         {% endblock %}
  232.                         {% block page_checkout_cart_add_promotion_input %}
  233.                             <input type="text"
  234.                                    name="code"
  235.                                    class="form-control"
  236.                                    id="addPromotionInput"
  237.                                    placeholder="{{ "checkout.addPromotionPlaceholder"|trans|striptags }}"
  238.                                    aria-label="{{ "checkout.addPromotionLabel"|trans|striptags }}"
  239.                                    aria-describedby="addPromotion"
  240.                                    required="required">
  241.                         {% endblock %}
  242.                         {% block page_checkout_cart_add_promotion_submit %}
  243.                             {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `input-group-append` wrapper and uses elements as direct childs of `input-group` #}
  244.                             {% if feature('v6.5.0.0') %}
  245.                                 <button class="btn btn-secondary"
  246.                                         type="submit"
  247.                                         id="addPromotion">
  248.                                     {% sw_icon 'checkmark' %}
  249.                                 </button>
  250.                             {% else %}
  251.                                 <div class="input-group-append">
  252.                                     <button class="btn btn-secondary"
  253.                                             type="submit"
  254.                                             id="addPromotion">
  255.                                         {% sw_icon 'checkmark' %}
  256.                                     </button>
  257.                                 </div>
  258.                             {% endif %}
  259.                         {% endblock %}
  260.                     </div>
  261.                 {% endblock %}
  262.             </form>
  263.         {% endblock %}
  264.     </div>
  265.     {% block page_checkout_cart_action_proceed %}
  266.         {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  267.         {% if feature('v6.5.0.0') %}
  268.             <div class="checkout-aside-action d-grid">
  269.                 <a href="{{ path('frontend.checkout.confirm.page') }}"
  270.                    class="btn btn-primary btn-lg begin-checkout-btn"
  271.                    title="{{ "checkout.proceedLink"|trans|striptags }}">
  272.                     {{ "checkout.proceedLink"|trans|sw_sanitize }}
  273.                 </a>
  274.             </div>
  275.         {% else %}
  276.             <div class="checkout-aside-action">
  277.                 <a href="{{ path('frontend.checkout.confirm.page') }}"
  278.                    class="btn btn-primary btn-block btn-lg begin-checkout-btn"
  279.                    title="{{ "checkout.proceedLink"|trans|striptags }}">
  280.                     {{ "checkout.proceedLink"|trans|sw_sanitize }}
  281.                 </a>
  282.             </div>
  283.         {% endif %}
  284.     {% endblock %}
  285. {% endblock %}