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.                             {% block page_checkout_cart_add_product_csrf %}
  71.                                 {{ sw_csrf('frontend.checkout.product.add-by-number') }}
  72.                             {% endblock %}
  73.                             {% block page_checkout_cart_add_product_redirect %}
  74.                                 <input type="hidden"
  75.                                        name="redirectTo"
  76.                                        value="frontend.checkout.cart.page">
  77.                             {% endblock %}
  78.                             {% block page_checkout_cart_add_product_input_group %}
  79.                                 <div class="input-group">
  80.                                     {% block page_checkout_cart_add_product_label %}
  81.                                         <label class="{{ visuallyHiddenClass }}" for="addProductInput">
  82.                                             {{ "checkout.addProductLabel"|trans|sw_sanitize }}
  83.                                         </label>
  84.                                     {% endblock %}
  85.                                     {% block page_checkout_cart_add_product_input %}
  86.                                         <input type="text"
  87.                                                name="number"
  88.                                                class="form-control"
  89.                                                id="addProductInput"
  90.                                                placeholder="{{ "checkout.addProductPlaceholder"|trans|striptags }}"
  91.                                                aria-label="{{ "checkout.addProductLabel"|trans|striptags }}"
  92.                                                aria-describedby="addProductButton"
  93.                                                required="required">
  94.                                     {% endblock %}
  95.                                     {% block page_checkout_cart_add_product_submit %}
  96.                                         {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `input-group-append` wrapper and uses elements as direct childs of `input-group` #}
  97.                                         {% if feature('v6.5.0.0') %}
  98.                                             <button class="btn btn-secondary"
  99.                                                     type="submit"
  100.                                                     id="addProductButton">
  101.                                                 {% sw_icon 'checkmark' %}
  102.                                             </button>
  103.                                         {% else %}
  104.                                             <div class="input-group-append">
  105.                                                 <button class="btn btn-secondary"
  106.                                                         type="submit"
  107.                                                         id="addProductButton">
  108.                                                     {% sw_icon 'checkmark' %}
  109.                                                 </button>
  110.                                             </div>
  111.                                         {% endif %}
  112.                                     {% endblock %}
  113.                                 </div>
  114.                             {% endblock %}
  115.                         </form>
  116.                     </div>
  117.                 {% endblock %}
  118.                 {% block page_checkout_cart_shipping_costs %}
  119.                     <div class="col-md-8 cart-shipping-costs-container">
  120.                         <form name="precalc"
  121.                               method="post"
  122.                               action="{{ path('frontend.checkout.configure') }}"
  123.                               data-form-auto-submit="true">
  124.                             {% block page_checkout_cart_shipping_costs_csrf %}
  125.                                 {{ sw_csrf('frontend.checkout.configure') }}
  126.                             {% endblock %}
  127.                             {% block page_checkout_cart_shipping_costs_trigger %}
  128.                                 <a class="btn btn-link cart-shipping-costs-btn"
  129.                                    {{ dataBsToggleAttr }}="collapse"
  130.                                    href="#collapseShippingCost"
  131.                                    role="button"
  132.                                    aria-expanded="false"
  133.                                    aria-controls="collapseExample">
  134.                                     {{ "checkout.shippingCosts"|trans|sw_sanitize }}
  135.                                     {% block page_checkout_cart_shipping_costs_trigger_icon %}
  136.                                         {% sw_icon 'arrow-medium-right' style { 'pack':'solid', 'size': 'sm' } %}
  137.                                     {% endblock %}
  138.                                 </a>
  139.                             {% endblock %}
  140.                             {% block page_checkout_cart_shipping_costs_form_group %}
  141.                                 <div class="collapse" id="collapseShippingCost">
  142.                                     {% block page_checkout_cart_shipping_costs_form_group_country %}
  143.                                         {% if not context.customer %}
  144.                                             <div class="form-group">
  145.                                                 <label for="countryId">{{ "checkout.shippingCountry"|trans|sw_sanitize }}</label>
  146.                                                 <select class="{{ formSelectClass }}" type="text" id="countryId" name="countryId">
  147.                                                     {% for country in page.countries %}
  148.                                                         <option value="{{ country.id }}"
  149.                                                             {{ country.id == context.shippingLocation.country.id ? 'selected="selected"' : '' }}>
  150.                                                             {{ country.translated.name }}
  151.                                                         </option>
  152.                                                     {% endfor %}
  153.                                                 </select>
  154.                                             </div>
  155.                                         {% endif %}
  156.                                     {% endblock %}
  157.                                     {% block page_checkout_cart_shipping_costs_form_group_payment_method %}
  158.                                         <div class="form-group">
  159.                                             <label for="paymentMethodId">{{ "checkout.paymentMethod"|trans|sw_sanitize }}</label>
  160.                                             <select class="{{ formSelectClass }}" type="text" id="paymentMethodId" name="paymentMethodId">
  161.                                                 {% if context.paymentMethod.id not in page.paymentMethods.ids %}
  162.                                                     <option value="{{ context.paymentMethod.id }}"
  163.                                                             selected="selected"
  164.                                                             disabled="disabled">
  165.                                                         {{ context.paymentMethod.translated.name }} {{ "checkout.notAvailableSuffix"|trans|sw_sanitize }}
  166.                                                     </option>
  167.                                                 {% endif %}
  168.                                                 {% for payment in page.paymentMethods %}
  169.                                                     <option value="{{ payment.id }}"
  170.                                                         {% if payment.id == context.paymentMethod.id %} selected="selected"{% endif %}>
  171.                                                         {{ payment.translated.name }}
  172.                                                     </option>
  173.                                                 {% endfor %}
  174.                                             </select>
  175.                                         </div>
  176.                                     {% endblock %}
  177.                                     {% block page_checkout_cart_shipping_costs_form_group_shipping_method %}
  178.                                         <div class="form-group">
  179.                                             <label for="shippingMethodId">{{ "checkout.shippingMethod"|trans|sw_sanitize }}</label>
  180.                                             <select class="{{ formSelectClass }}" type="text" id="shippingMethodId" name="shippingMethodId">
  181.                                                 {% if context.shippingMethod.id not in page.shippingMethods.ids %}
  182.                                                     <option value="{{ context.shippingMethod.id }}"
  183.                                                             selected="selected"
  184.                                                             disabled="disabled">
  185.                                                         {{ context.shippingMethod.translated.name }} {{ "checkout.notAvailableSuffix"|trans|sw_sanitize }}
  186.                                                     </option>
  187.                                                 {% endif %}
  188.                                                 {% for shipping in page.shippingMethods %}
  189.                                                     <option value="{{ shipping.id }}"
  190.                                                         {% if shipping.id == context.shippingMethod.id %} selected="selected"{% endif %}>
  191.                                                         {{ shipping.translated.name }}
  192.                                                     </option>
  193.                                                 {% endfor %}
  194.                                             </select>
  195.                                         </div>
  196.                                     {% endblock %}
  197.                                     <input type="hidden" name="redirectTo" value="frontend.checkout.cart.page">
  198.                                 </div>
  199.                             {% endblock %}
  200.                         </form>
  201.                     </div>
  202.                 {% endblock %}
  203.             </div>
  204.         {% endblock %}
  205.     {% endblock %}
  206. {% endblock %}
  207. {% block page_checkout_aside_actions %}
  208.     <div class="checkout-aside-action">
  209.         {% block page_checkout_cart_add_promotion %}
  210.             <form action="{{ path('frontend.checkout.promotion.add') }}"
  211.                   class="cart-add-promotion"
  212.                   data-form-csrf-handler="true"
  213.                   method="post">
  214.                 {% block page_checkout_cart_add_promotion_csrf %}
  215.                     {{ sw_csrf('frontend.checkout.promotion.add') }}
  216.                 {% endblock %}
  217.                 {% block page_checkout_cart_add_promotion_forward %}
  218.                     <input type="hidden"
  219.                            name="redirectTo"
  220.                            value="frontend.checkout.cart.page">
  221.                 {% endblock %}
  222.                 {% block page_checkout_cart_add_promotion_input_group %}
  223.                     <div class="input-group checkout-aside-add-code">
  224.                         {% block page_checkout_cart_add_promotion_label %}
  225.                             <label class="{{ visuallyHiddenClass }}" for="addPromotionInput">
  226.                                 {{ "checkout.addPromotionLabel"|trans|sw_sanitize }}
  227.                             </label>
  228.                         {% endblock %}
  229.                         {% block page_checkout_cart_add_promotion_input %}
  230.                             <input type="text"
  231.                                    name="code"
  232.                                    class="form-control"
  233.                                    id="addPromotionInput"
  234.                                    placeholder="{{ "checkout.addPromotionPlaceholder"|trans|striptags }}"
  235.                                    aria-label="{{ "checkout.addPromotionLabel"|trans|striptags }}"
  236.                                    aria-describedby="addPromotion"
  237.                                    required="required">
  238.                         {% endblock %}
  239.                         {% block page_checkout_cart_add_promotion_submit %}
  240.                             {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `input-group-append` wrapper and uses elements as direct childs of `input-group` #}
  241.                             {% if feature('v6.5.0.0') %}
  242.                                 <button class="btn btn-secondary"
  243.                                         type="submit"
  244.                                         id="addPromotion">
  245.                                     {% sw_icon 'checkmark' %}
  246.                                 </button>
  247.                             {% else %}
  248.                                 <div class="input-group-append">
  249.                                     <button class="btn btn-secondary"
  250.                                             type="submit"
  251.                                             id="addPromotion">
  252.                                         {% sw_icon 'checkmark' %}
  253.                                     </button>
  254.                                 </div>
  255.                             {% endif %}
  256.                         {% endblock %}
  257.                     </div>
  258.                 {% endblock %}
  259.             </form>
  260.         {% endblock %}
  261.     </div>
  262.     {% block page_checkout_cart_action_proceed %}
  263.         {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  264.         {% if feature('v6.5.0.0') %}
  265.             <div class="checkout-aside-action d-grid">
  266.                 <a href="{{ path('frontend.checkout.confirm.page') }}"
  267.                    class="btn btn-primary btn-lg begin-checkout-btn"
  268.                    title="{{ "checkout.proceedLink"|trans|striptags }}">
  269.                     {{ "checkout.proceedLink"|trans|sw_sanitize }}
  270.                 </a>
  271.             </div>
  272.         {% else %}
  273.             <div class="checkout-aside-action">
  274.                 <a href="{{ path('frontend.checkout.confirm.page') }}"
  275.                    class="btn btn-primary btn-block btn-lg begin-checkout-btn"
  276.                    title="{{ "checkout.proceedLink"|trans|striptags }}">
  277.                     {{ "checkout.proceedLink"|trans|sw_sanitize }}
  278.                 </a>
  279.             </div>
  280.         {% endif %}
  281.     {% endblock %}
  282. {% endblock %}