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