All things Shopify and commerce
Hi, I use Debut theme and will release my homepage on 27/11 and I want to have a countdown timer on the password page? Does anyone know how to add that? I only want a countdown timer, not connected to any product or something like that, only a visual timer.
I hope someone know how to help me.
Regards Daniel
Solved! Go to the solution
This is an accepted solution.
I found how to fix it on this site: https://easycodeguide.com/how-to-add-a-simple-sales-countdown-timer-to-your-shopify-theme.html (I did some modification in the code.)
If someone also searching for this, here is how I did.
I created a new snippet and pasted this code:
{% if end_date != blank %}<div class="timer">{% if title != blank %}<h4 class="timer__title">{{ title }}</h4>{% endif %}<div class="timer-display"><div class="timer-block"><span class="timer-block__num js-timer-days">00</span><span class="timer-block__unit">Days</span></div><div class="timer-block"><span class="timer-block__num js-timer-hours">00</span><span class="timer-block__unit">Hours</span></div><div class="timer-block"><span class="timer-block__num js-timer-minutes">00</span><span class="timer-block__unit">Minutes</span></div><div class="timer-block"><span class="timer-block__num js-timer-seconds">00</span><span class="timer-block__unit">Seconds</span></div></div></div><br><br><style>/* styles for timer */.timer {/*background: #f6fafd;*/padding: 10px;margin: 10px 0;}.timer--expired {display: none;}.timer__title {@extend .paragraph;text-align: center;}.timer-display {display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;margin-top: 5px;}.timer-block {position: relative;width: 25%;padding: 0 10px;&:not(:last-child):after {content: ':';position: absolute;right: 0;top: 3px;}}.timer-block__num,.timer-block__unit {display: block;text-align: center;font-size: 32px;font-weight: 900;}</style><script type="text/javascript">var second = 1000,minute = second * 60,hour = minute * 60,day = hour * 24;var countDown = new Date('{{- end_date -}}').getTime(),x = setInterval(function() {var now = new Date().getTime(),distance = countDown - now;document.querySelector('.js-timer-days').innerText = Math.floor(distance / (day)),document.querySelector('.js-timer-hours').innerText = Math.floor((distance % (day)) / (hour)),document.querySelector('.js-timer-minutes').innerText = Math.floor((distance % (hour)) / (minute)),document.querySelector('.js-timer-seconds').innerText = Math.floor((distance % (minute)) / second);}, second)</script>{% endif %}
{% include 'shopifyexplorer-countdown-timer',
end_date: "Nov 27, 2020"
%}
Hi, @IdealDesign,
Hank here from Shopify.
Having a countdown timer on your password page can build a lot of excitement for customers that come across your store, eager to see what lies beyond the password page!
A very popular app for this function is Coming Soon Page. They advertise on that page that the app can "Use attractive backgrounds and a countdown timer to get your audience excited about the big launch"!
There also may be other ways this may be written into the code for your theme, so if you were to share your store URL then, hopefully, someone with more technical skills in the community will come across this and be able to add some value to you here, but if not, your best bet might be to reach out to one of our Shopify Experts, who you can hire to do almost any custom work on your store.
If you were to reach out to them about this query, they would be able to resolve this issue for you.
I will also move this thread to a more applicable board which may offer more coverage for your post, but if you have any additional questions, let me know!
All the best,
Hank
Hank | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
This is an accepted solution.
I found how to fix it on this site: https://easycodeguide.com/how-to-add-a-simple-sales-countdown-timer-to-your-shopify-theme.html (I did some modification in the code.)
If someone also searching for this, here is how I did.
I created a new snippet and pasted this code:
{% if end_date != blank %}<div class="timer">{% if title != blank %}<h4 class="timer__title">{{ title }}</h4>{% endif %}<div class="timer-display"><div class="timer-block"><span class="timer-block__num js-timer-days">00</span><span class="timer-block__unit">Days</span></div><div class="timer-block"><span class="timer-block__num js-timer-hours">00</span><span class="timer-block__unit">Hours</span></div><div class="timer-block"><span class="timer-block__num js-timer-minutes">00</span><span class="timer-block__unit">Minutes</span></div><div class="timer-block"><span class="timer-block__num js-timer-seconds">00</span><span class="timer-block__unit">Seconds</span></div></div></div><br><br><style>/* styles for timer */.timer {/*background: #f6fafd;*/padding: 10px;margin: 10px 0;}.timer--expired {display: none;}.timer__title {@extend .paragraph;text-align: center;}.timer-display {display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;margin-top: 5px;}.timer-block {position: relative;width: 25%;padding: 0 10px;&:not(:last-child):after {content: ':';position: absolute;right: 0;top: 3px;}}.timer-block__num,.timer-block__unit {display: block;text-align: center;font-size: 32px;font-weight: 900;}</style><script type="text/javascript">var second = 1000,minute = second * 60,hour = minute * 60,day = hour * 24;var countDown = new Date('{{- end_date -}}').getTime(),x = setInterval(function() {var now = new Date().getTime(),distance = countDown - now;document.querySelector('.js-timer-days').innerText = Math.floor(distance / (day)),document.querySelector('.js-timer-hours').innerText = Math.floor((distance % (day)) / (hour)),document.querySelector('.js-timer-minutes').innerText = Math.floor((distance % (hour)) / (minute)),document.querySelector('.js-timer-seconds').innerText = Math.floor((distance % (minute)) / second);}, second)</script>{% endif %}
{% include 'shopifyexplorer-countdown-timer',
end_date: "Nov 27, 2020"
%}
How can i change the Release Date to a certain hour? Say April 1, 2021 plus a 24 hour format. So for example April 1, 2021, 18:00?
Thanks in advance
Alex
Date & TIme format: "Sep 25, 2021 09:00
{% include 'shopifyexplorer-countdown-timer',
end_date: "Nov 27, 2020 18:00"
%}
Hi. This did not work for me, I went step by step. Creating the snippet and adding the additional code to the password.liquid section.
Hello
Thanks for this - it's perfect!
However it doesn't scale with my theme, I'm using a responsive site - minimal but it doesn't scale for different devices.
I have queried this and someone mentioned using Media Queries however I do not know enough about CSS & HMTL to input it into the code.
Can you help? I would love any help from anyone!
Thanks
Where do I add this in password liquid?
At the end or beginning?
Where is the password liquid is the code supposed to be added to? You didn't say @IdealDesign
@MaileLacno Just Put it in the "Password.liquid" somewhere in between "<html>" and "</html>"
@IdealDesign is it possible to add the Countdown IN this Box?
Or in the White Header?
Can´t find a solution for that.
if you can, only that you would have to modify the liquid of the slider to be able to place it, contact me and we will see it
How do I make the timer fit for mobile devices also?
Hello my friend, I tell you that to adapt it to mobile, you would have to know css to be able to adapt it because if not you may not be able to but you can contact me if I could help you
Hi, ive do the same way but my countdown is at the bottom and not at the middle or top. Do you have any solution for it?
After many searches and coding too much code, I managed to find this APP that is helping me, it is also compatible with Android and IOS I recommend it, it gives you a code to place it where you want, center it or place it on the sides, you can also use the same code for products
You can easily add a countdown timer on Password page using Essential Countdown Timer app.
Here is the detailed article on How to add a Shopify countdown timer on password page.
Here is a quick video going over all steps:
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024