{% set timer_text = homepage.pagedata['Timer Text'][0]['value'] %}

{% if homepage.pagedata['Show Delivery Timer'][0]['value'] == '1' %}
    <div class="deliveryTimer {% if no_wrapper is not empty %}noWrapper{% endif %} {{ class }}" data-cutoff="{{ order_until['timer'] }} GMT">
        {% if no_wrapper is empty %}
            <div class="wrapper">
        {% endif %}
            {% if order_until['timer'] != '' and order_until['next_day'] != '' and timer_text is not empty %}
                {{ timer_text|replace({'{{time}}':'<span class="timer">0hrs 0mins 0secs</span>'})|replace({'{{day}}': '<span class="day">' ~ order_until['next_day'] ~ '</span>' })|raw }}
            {% else %}
                <p>
                    Order
                    <span>
                        Monday to Friday before
    
                        {% if order_until['delivery_time'] != '' %}
                            {{ order_until['delivery_time']  }}
                        {% else %}
                            15:30pm
                        {% endif %}
    
                    </span>
                    to guarantee next day delivery
                </p>
            {% endif %}
    
        {% if no_wrapper is empty %}
            </div>
        {% endif %}
    </div>
{% endif %}

