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.                                 {% set PHYSICAL_STATE = constant('Shopware\\Core\\Content\\Product\\State::IS_PHYSICAL') %}
  131.                                 {% if page.cart.lineItems.hasLineItemWithState(PHYSICAL_STATE) %}
  132.                                     <a class="btn btn-link cart-shipping-costs-btn"
  133.                                        {{ dataBsToggleAttr }}="collapse"
  134.                                        href="#collapseShippingCost"
  135.                                        role="button"
  136.                                        aria-expanded="false"
  137.                                        aria-controls="collapseExample">
  138.                                         {{ "checkout.shippingCosts"|trans|sw_sanitize }}
  139.                                         {% block page_checkout_cart_shipping_costs_trigger_icon %}
  140.                                             {% sw_icon 'arrow-medium-right' style { 'pack':'solid', 'size': 'sm' } %}
  141.                                         {% endblock %}
  142.                                     </a>
  143.                                 {% endif %}
  144.                             {% endblock %}
  145.                             {% block page_checkout_cart_shipping_costs_form_group %}
  146.                                 <div class="collapse" id="collapseShippingCost">
  147.                                     {% block page_checkout_cart_shipping_costs_form_group_country %}
  148.                                         {% if not context.customer %}
  149.                                             <div class="form-group">
  150.                                                 <label for="countryId">{{ "checkout.shippingCountry"|trans|sw_sanitize }}</label>
  151.                                                 <select class="{{ formSelectClass }}" type="text" id="countryId" name="countryId">
  152.                                                     {% for country in page.countries %}
  153.                                                         <option value="{{ country.id }}"
  154.                                                             {{ country.id == context.shippingLocation.country.id ? 'selected="selected"' : '' }}>
  155.                                                             {{ country.translated.name }}
  156.                                                         </option>
  157.                                                     {% endfor %}
  158.                                                 </select>
  159.                                             </div>
  160.                                         {% endif %}
  161.                                     {% endblock %}
  162.                                     {% block page_checkout_cart_shipping_costs_form_group_payment_method %}
  163.                                         <div class="form-group">
  164.                                             <label for="paymentMethodId">{{ "checkout.paymentMethod"|trans|sw_sanitize }}</label>
  165.                                             <select class="{{ formSelectClass }}" type="text" id="paymentMethodId" name="paymentMethodId">
  166.                                                 {% if context.paymentMethod.id not in page.paymentMethods.ids %}
  167.                                                     <option value="{{ context.paymentMethod.id }}"
  168.                                                             selected="selected"
  169.                                                             disabled="disabled">
  170.                                                         {{ context.paymentMethod.translated.name }} {{ "checkout.notAvailableSuffix"|trans|sw_sanitize }}
  171.                                                     </option>
  172.                                                 {% endif %}
  173.                                                 {% for payment in page.paymentMethods %}
  174.                                                     <option value="{{ payment.id }}"
  175.                                                         {% if payment.id == context.paymentMethod.id %} selected="selected"{% endif %}>
  176.                                                         {{ payment.translated.name }}
  177.                                                     </option>
  178.                                                 {% endfor %}
  179.                                             </select>
  180.                                         </div>
  181.                                     {% endblock %}
  182.                                     {% block page_checkout_cart_shipping_costs_form_group_shipping_method %}
  183.                                         <div class="form-group">
  184.                                             <label for="shippingMethodId">{{ "checkout.shippingMethod"|trans|sw_sanitize }}</label>
  185.                                             <select class="{{ formSelectClass }}" type="text" id="shippingMethodId" name="shippingMethodId">
  186.                                                 {% if context.shippingMethod.id not in page.shippingMethods.ids %}
  187.                                                     <option value="{{ context.shippingMethod.id }}"
  188.                                                             selected="selected"
  189.                                                             disabled="disabled">
  190.                                                         {{ context.shippingMethod.translated.name }} {{ "checkout.notAvailableSuffix"|trans|sw_sanitize }}
  191.                                                     </option>
  192.                                                 {% endif %}
  193.                                                 {% for shipping in page.shippingMethods %}
  194.                                                     <option value="{{ shipping.id }}"
  195.                                                         {% if shipping.id == context.shippingMethod.id %} selected="selected"{% endif %}>
  196.                                                         {{ shipping.translated.name }}
  197.                                                     </option>
  198.                                                 {% endfor %}
  199.                                             </select>
  200.                                         </div>
  201.                                     {% endblock %}
  202.                                     <input type="hidden" name="redirectTo" value="frontend.checkout.cart.page">
  203.                                 </div>
  204.                             {% endblock %}
  205.                         </form>
  206.                     </div>
  207.                 {% endblock %}
  208.             </div>
  209.         {% endblock %}
  210.     {% endblock %}
  211. {% endblock %}
  212. {% block page_checkout_aside_actions %}
  213.     <div class="checkout-aside-action">
  214.         {% block page_checkout_cart_add_promotion %}
  215.             <form action="{{ path('frontend.checkout.promotion.add') }}"
  216.                   class="cart-add-promotion"
  217.                   data-form-csrf-handler="true"
  218.                   method="post">
  219.                 {# @deprecated tag:v6.5.0 - Block page_checkout_cart_add_promotion_csrf will be removed. #}
  220.                 {% block page_checkout_cart_add_promotion_csrf %}
  221.                     {{ sw_csrf('frontend.checkout.promotion.add') }}
  222.                 {% endblock %}
  223.                 {% block page_checkout_cart_add_promotion_forward %}
  224.                     <input type="hidden"
  225.                            name="redirectTo"
  226.                            value="frontend.checkout.cart.page">
  227.                 {% endblock %}
  228.                 {% block page_checkout_cart_add_promotion_input_group %}
  229.                     <div class="input-group checkout-aside-add-code">
  230.                         {% block page_checkout_cart_add_promotion_label %}
  231.                             <label class="{{ visuallyHiddenClass }}" for="addPromotionInput">
  232.                                 {{ "checkout.addPromotionLabel"|trans|sw_sanitize }}
  233.                             </label>
  234.                         {% endblock %}
  235.                         {% block page_checkout_cart_add_promotion_input %}
  236.                             <input type="text"
  237.                                    name="code"
  238.                                    class="form-control"
  239.                                    id="addPromotionInput"
  240.                                    placeholder="{{ "checkout.addPromotionPlaceholder"|trans|striptags }}"
  241.                                    aria-label="{{ "checkout.addPromotionLabel"|trans|striptags }}"
  242.                                    aria-describedby="addPromotion"
  243.                                    required="required">
  244.                         {% endblock %}
  245.                         {% block page_checkout_cart_add_promotion_submit %}
  246.                             {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `input-group-append` wrapper and uses elements as direct childs of `input-group` #}
  247.                             {% if feature('v6.5.0.0') %}
  248.                                 <button class="btn btn-secondary"
  249.                                         type="submit"
  250.                                         id="addPromotion">
  251.                                     {% sw_icon 'checkmark' %}
  252.                                 </button>
  253.                             {% else %}
  254.                                 <div class="input-group-append">
  255.                                     <button class="btn btn-secondary"
  256.                                             type="submit"
  257.                                             id="addPromotion">
  258.                                         {% sw_icon 'checkmark' %}
  259.                                     </button>
  260.                                 </div>
  261.                             {% endif %}
  262.                         {% endblock %}
  263.                     </div>
  264.                 {% endblock %}
  265.             </form>
  266.         {% endblock %}
  267.     </div>
  268.     {% block page_checkout_cart_action_proceed %}
  269.         {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  270.         {% if feature('v6.5.0.0') %}
  271.             <div class="checkout-aside-action d-grid">
  272.                 <a href="{{ path('frontend.checkout.confirm.page') }}"
  273.                    class="btn btn-primary btn-lg begin-checkout-btn"
  274.                    title="{{ "checkout.proceedLink"|trans|striptags }}">
  275.                     {{ "checkout.proceedLink"|trans|sw_sanitize }}
  276.                 </a>
  277.             </div>
  278.         {% else %}
  279.             <div class="checkout-aside-action">
  280.                 <a href="{{ path('frontend.checkout.confirm.page') }}"
  281.                    class="btn btn-primary btn-block btn-lg begin-checkout-btn"
  282.                    title="{{ "checkout.proceedLink"|trans|striptags }}">
  283.                     {{ "checkout.proceedLink"|trans|sw_sanitize }}
  284.                 </a>
  285.             </div>
  286.         {% endif %}
  287.     {% endblock %}
  288. {% endblock %}