{% set totalWeight = 0 %}
{% for lineItem in page.cart.lineItems %}
    {%  if lineItem.deliveryInformation.weight != null %}
        {% set totalWeight = totalWeight + (lineItem.quantity * lineItem.deliveryInformation.weight) %}
    {% endif %}
{% endfor %}
{% block page_checkout_confirm_delivery_date %}
    {% if page.extensions.DeliveryDateConfig.data.deliveryDateActive %}
        <div class="confirm-delivery-date{% if totalWeight < 0.5 %} do-not-show{% endif %}">
            <div class="row">
                <div class="col-sm-12">
                    <div class="card checkout-card">
                        <div class="card-body">
                            <div class="card-title">
                                {{ "dtgs-delivery-date.confirmDatePanelHeader"|trans }}
                            </div>
                            <p>
                                {{ "dtgs-delivery-date.confirmDatePanelText"|trans }}
                            </p>
                            <input
                                    type="text"
                                    id="dtgs-datepicker-inputfield"
                                    class="form-control dtgs-datepicker-input{% if formViolations.getViolations('deliverydate') is not empty %} is-invalid{% endif %}"
                                    form="confirmOrderForm"
                                    {% if page.extensions.DeliveryDateConfig.data.deliveryDateRequired %}required="required"{% endif %}
                                    {% if page.extensions.DeliveryDateConfig.data.deliveryDateInSession is not empty %}value="{{ page.extensions.DeliveryDateConfig.data.deliveryDateInSession }}"{% endif %} />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}
