New Shopify Certification now available: Liquid Storefronts for Theme Developers

Add timer on checkout page

Ekta_Merai
Shopify Partner
2 0 1

Hello,

Hope you are well!!

I have 1 query regarding add timer on checkout page. Like this https://prnt.sc/_6FTL5H5ToUr
I have added script but it doesn't work at all. So if you have any idea could you please help me out it would be great.

Thank you 



  

Reply 1 (1)
BrandBuilding88
Excursionist
29 2 6

try this  
{% unless section.settings.cart_timer_text == blank %}
<div class="cart-timer" data-timer-sec="{{ section.settings.cart_timer_sec }}">
<div class="alert alert-warning rte">
{{ section.settings.cart_timer_text }}
</div>
</div>
{% endunless %}  

then adding in the settings 

{
"type": "header",
"content": "Cart Timer"
},
{
"type": "richtext",
"id": "cart_timer_text",
"label": "Text",
"default": "<p>Your order is reserved for <strong>[time]</strong></p>",
"info": "Leave empty to disable this feature"
},
{
"type": "text",
"id": "cart_timer_sec",
"label": "Time (sec)",
"default": "300"
},