Shopify themes, liquid, logos, and UX
Hello Everyone!
I am using dawn theme in shopify. I want to add text and timer to the product page of my website. I have added referral website and image below. This is exactly what I would like to put on my website. Please give me that code. And it would be very helpful if you could give me instructions on where to add the code. It will be beneficial for everyone. Please help me. thank you.
Password: Admin
What I need!
Referral website: https://zentaro.nl/collections/dames/products/isabella-herfst-suit
To add text and a countdown timer to your product page in the Dawn theme, follow these steps:
Code:
<div class="custom-timer" style="text-align: center; margin-top: 20px;">
<p style="font-size: 18px; font-weight: bold;">Limited Offer Ends In:</p>
<div id="countdown-timer" style="font-size: 20px; color: red; font-weight: bold;"></div>
</div>
<script>
function startCountdown(durationInHours) {
const endTime = new Date().getTime() + durationInHours * 60 * 60 * 1000;
const timerElement = document.getElementById('countdown-timer');
function updateTimer() {
const now = new Date().getTime();
const distance = endTime - now;
if (distance < 0) {
timerElement.innerHTML = "Offer Expired";
clearInterval(timer);
return;
}
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
timerElement.innerHTML = `${hours}h ${minutes}m ${seconds}s`;
}
updateTimer();
const timer = setInterval(updateTimer, 1000);
}
// Start a 24-hour countdown
startCountdown(24);
</script>
If you have other questions, I am willing to answer them more.
Best regards,
Daisy
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025