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

  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/component/checkout/cart-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/component/line-item/line-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.                               class="cart-add-product"
  58.                               method="post">
  59.                             {% block page_checkout_cart_add_product_redirect %}
  60.                                 <input type="hidden"
  61.                                        name="redirectTo"
  62.                                        value="frontend.checkout.cart.page">
  63.                             {% endblock %}
  64.                             {% block page_checkout_cart_add_product_input_group %}
  65.                                 <div class="input-group">
  66.                                     {% block page_checkout_cart_add_product_label %}
  67.                                         <label class="visually-hidden" for="addProductInput">
  68.                                             {{ "checkout.addProductLabel"|trans|sw_sanitize }}
  69.                                         </label>
  70.                                     {% endblock %}
  71.                                     {% block page_checkout_cart_add_product_input %}
  72.                                         <input type="text"
  73.                                                name="number"
  74.                                                class="form-control"
  75.                                                id="addProductInput"
  76.                                                placeholder="{{ "checkout.addProductPlaceholder"|trans|striptags }}"
  77.                                                aria-label="{{ "checkout.addProductLabel"|trans|striptags }}"
  78.                                                aria-describedby="addProductButton"
  79.                                                required="required">
  80.                                     {% endblock %}
  81.                                     {% block page_checkout_cart_add_product_submit %}
  82.                                         <button class="btn btn-secondary"
  83.                                                 type="submit"
  84.                                                 id="addProductButton">
  85.                                             {% sw_icon 'checkmark' %}
  86.                                         </button>
  87.                                     {% endblock %}
  88.                                 </div>
  89.                             {% endblock %}
  90.                         </form>
  91.                     </div>
  92.                 {% endblock %}
  93.                 {% block page_checkout_cart_shipping_costs %}
  94.                     <div class="col-md-8 cart-shipping-costs-container">
  95.                         <form name="precalc"
  96.                               method="post"
  97.                               action="{{ path('frontend.checkout.configure') }}"
  98.                               data-form-auto-submit="true">
  99.                             {% block page_checkout_cart_shipping_costs_trigger %}
  100.                                 {% set PHYSICAL_STATE = constant('Shopware\\Core\\Content\\Product\\State::IS_PHYSICAL') %}
  101.                                 {% if page.cart.lineItems.hasLineItemWithState(PHYSICAL_STATE) %}
  102.                                     <a class="btn btn-link cart-shipping-costs-btn"
  103.                                        data-bs-toggle="collapse"
  104.                                        href="#collapseShippingCost"
  105.                                        role="button"
  106.                                        aria-expanded="false"
  107.                                        aria-controls="collapseExample">
  108.                                         {{ "checkout.shippingCosts"|trans|sw_sanitize }}
  109.                                         {% block page_checkout_cart_shipping_costs_trigger_icon %}
  110.                                             {% sw_icon 'arrow-medium-right' style { 'pack':'solid', 'size': 'sm' } %}
  111.                                         {% endblock %}
  112.                                     </a>
  113.                                 {% endif %}
  114.                             {% endblock %}
  115.                             {% block page_checkout_cart_shipping_costs_form_group %}
  116.                                 <div class="collapse" id="collapseShippingCost">
  117.                                     {% block page_checkout_cart_shipping_costs_form_group_country %}
  118.                                         {% if not context.customer %}
  119.                                             <div class="form-group">
  120.                                                 <label for="countryId">{{ "checkout.shippingCountry"|trans|sw_sanitize }}</label>
  121.                                                 <select class="form-select" type="text" id="countryId" name="countryId">
  122.                                                     {% for country in page.countries %}
  123.                                                         <option value="{{ country.id }}"
  124.                                                             {{ country.id == context.shippingLocation.country.id ? 'selected="selected"' : '' }}>
  125.                                                             {{ country.translated.name }}
  126.                                                         </option>
  127.                                                     {% endfor %}
  128.                                                 </select>
  129.                                             </div>
  130.                                         {% endif %}
  131.                                     {% endblock %}
  132.                                     {% block page_checkout_cart_shipping_costs_form_group_payment_method %}
  133.                                         <div class="form-group">
  134.                                             <label for="paymentMethodId">{{ "checkout.paymentMethod"|trans|sw_sanitize }}</label>
  135.                                             <select class="form-select" type="text" id="paymentMethodId" name="paymentMethodId">
  136.                                                 {% if context.paymentMethod.id not in page.paymentMethods.ids %}
  137.                                                     <option value="{{ context.paymentMethod.id }}"
  138.                                                             selected="selected"
  139.                                                             disabled="disabled">
  140.                                                         {{ context.paymentMethod.translated.name }} {{ "checkout.notAvailableSuffix"|trans|sw_sanitize }}
  141.                                                     </option>
  142.                                                 {% endif %}
  143.                                                 {% for payment in page.paymentMethods %}
  144.                                                     <option value="{{ payment.id }}"
  145.                                                         {% if payment.id == context.paymentMethod.id %} selected="selected"{% endif %}>
  146.                                                         {{ payment.translated.name }}
  147.                                                     </option>
  148.                                                 {% endfor %}
  149.                                             </select>
  150.                                         </div>
  151.                                     {% endblock %}
  152.                                     {% block page_checkout_cart_shipping_costs_form_group_shipping_method %}
  153.                                         <div class="form-group">
  154.                                             <label for="shippingMethodId">{{ "checkout.shippingMethod"|trans|sw_sanitize }}</label>
  155.                                             <select class="form-select" type="text" id="shippingMethodId" name="shippingMethodId">
  156.                                                 {% if context.shippingMethod.id not in page.shippingMethods.ids %}
  157.                                                     <option value="{{ context.shippingMethod.id }}"
  158.                                                             selected="selected"
  159.                                                             disabled="disabled">
  160.                                                         {{ context.shippingMethod.translated.name }} {{ "checkout.notAvailableSuffix"|trans|sw_sanitize }}
  161.                                                     </option>
  162.                                                 {% endif %}
  163.                                                 {% for shipping in page.shippingMethods %}
  164.                                                     <option value="{{ shipping.id }}"
  165.                                                         {% if shipping.id == context.shippingMethod.id %} selected="selected"{% endif %}>
  166.                                                         {{ shipping.translated.name }}
  167.                                                     </option>
  168.                                                 {% endfor %}
  169.                                             </select>
  170.                                         </div>
  171.                                     {% endblock %}
  172.                                     <input type="hidden" name="redirectTo" value="frontend.checkout.cart.page">
  173.                                 </div>
  174.                             {% endblock %}
  175.                         </form>
  176.                     </div>
  177.                 {% endblock %}
  178.             </div>
  179.         {% endblock %}
  180.     {% endblock %}
  181. {% endblock %}
  182. {% block page_checkout_aside_actions %}
  183.     <div class="checkout-aside-action">
  184.         {% block page_checkout_cart_add_promotion %}
  185.             <form action="{{ path('frontend.checkout.promotion.add') }}"
  186.                   class="cart-add-promotion"
  187.                   method="post">
  188.                 {% block page_checkout_cart_add_promotion_forward %}
  189.                     <input type="hidden"
  190.                            name="redirectTo"
  191.                            value="frontend.checkout.cart.page">
  192.                 {% endblock %}
  193.                 {% block page_checkout_cart_add_promotion_input_group %}
  194.                     <div class="input-group checkout-aside-add-code">
  195.                         {% block page_checkout_cart_add_promotion_label %}
  196.                             <label class="visually-hidden" for="addPromotionInput">
  197.                                 {{ "checkout.addPromotionLabel"|trans|sw_sanitize }}
  198.                             </label>
  199.                         {% endblock %}
  200.                         {% block page_checkout_cart_add_promotion_input %}
  201.                             <input type="text"
  202.                                    name="code"
  203.                                    class="form-control"
  204.                                    id="addPromotionInput"
  205.                                    placeholder="{{ "checkout.addPromotionPlaceholder"|trans|striptags }}"
  206.                                    aria-label="{{ "checkout.addPromotionLabel"|trans|striptags }}"
  207.                                    aria-describedby="addPromotion"
  208.                                    required="required">
  209.                         {% endblock %}
  210.                         {% block page_checkout_cart_add_promotion_submit %}
  211.                             <button class="btn btn-secondary"
  212.                                     type="submit"
  213.                                     id="addPromotion">
  214.                                 {% sw_icon 'checkmark' %}
  215.                             </button>
  216.                         {% endblock %}
  217.                     </div>
  218.                 {% endblock %}
  219.             </form>
  220.         {% endblock %}
  221.     </div>
  222.     {% block page_checkout_cart_action_proceed %}
  223.         <div class="checkout-aside-action d-grid">
  224.             <a href="{{ path('frontend.checkout.confirm.page') }}"
  225.                class="btn btn-primary btn-lg begin-checkout-btn"
  226.                title="{{ "checkout.proceedLink"|trans|striptags }}">
  227.                 {{ "checkout.proceedLink"|trans|sw_sanitize }}
  228.             </a>
  229.         </div>
  230.     {% endblock %}
  231. {% endblock %}