Cart timer / countdown (Dawn theme)

Hello,

I’d like to create a timer at the top of my cart drawer when a customer adds an item to the cart (when the cart becomes non-empty). I’m using Dawn theme.

This timer would run when the cart becomes non-empty; it would reset if the cart empties. And updates to the basket would have no impact on the timer, even visually.

I already have the HTML / CSS structure but I’m missing the javascript. I’ve tried using Chat GPT but to no avail. This time, I can’t do it. For example, when the shopping cart updates (adding a new product or changing the quantities of a product), the timer stops. A lot of little problems that I can’t solve.

I know there are a lot of applications for this but I’m trying to create my own theme and I’d like to integrate this functionality without having to use an application.

Does anyone have a solution or a piece of code to share with me, please? ?

Thank you in advance for your help.

@Money_Cooker :waving_hand: what’s the point of this FOMO,

what happens when the timer runs what are you gonna do? lock the customer out from from the store.

Before adding extra doodads and noise to a store make sure there’s some sort of actual data to back up such decisions and your not just mindlessly copying some other site or listicle that mentions it but provides no real proof nor guarantee of outcomes.

but I’m trying to create my own theme and I’d like to integrate this functionality

https://shopify.dev/themes/

without having to use an application.

Apps make money and save time, especially for features that don’t yet have any data to justify spending time making them from scratch.

Get a free app, ab-test conversion, validate assumptions , then make decision backed by hard data and revenue-generation.

tried using Chat GPT but

Chatgpt and other LLM’s are probabilistic liars that con you out of your time; if you don’t know the language some thing randomly spits out you can’t tell how flawed and filled with typos it is.

LLM’s can help bootstrap things, especially boilerplate, but it comes with a separate burden of validating what it generates randomly.

I don’t think I’ve asked anyone’s opinion about the feature I’m trying to add to my theme. I came to this site with my question in order to get an answer and a solution to my problem.

Please avoid making assumptions about people you don’t know. If I ask my question, it’s because the feature I’m trying to add is important to my theme.

Thanks for the great link everyone knows about. How could I have done without you? :folded_hands: If I wrote this topic, it’s because I searched everywhere on Google, on Shopify Dev, on Shopify Community (and other) and didn’t find the solution.

I didn’t come here for someone I don’t know to give me moral lessons that should be kept to oneself.

As I wrote at the outset, I’m not looking for an application to install on my store. If that had been one of my solutions, I’d never have written this post.

And just so you know, I’ve been using Copilot and Chat GPT for a long time, and these AIs have helped me learn and develop a lot.

Please don’t reply to my topic again if it’s not to provide a solution :wink:

1 Like

I don’t think I’ve asked anyone’s opinion about the feature I’m trying to add to my theme. I came to this site with my question in order to get an answer and a solution to my problem.

Try facts , Bringing Dark Patterns to Light by the FTC

https://www.ftc.gov/system/files/ftc_gov/pdf/P214800%20Dark%20Patterns%20Report%209.14.2022%20-%20FINAL.pdf

Part of providing real solutions for merchants is addressing fundamental problems with proven approaches which includes addressing problems in advance with candor, not sentimental wish fulfillment that ignores the problems.

If someone is trying to learn, does it matter if they use an LLM? Its been working for them so far. And why bother replying to the thread at all if it’s just going to be an unhelpful opinion piece.
@Money_Cooker did you find a solution? I can take a look if you still need it

You can use a countdown block inside your theme instead of custom JS. ThemeStack includes a countdown that works with Dawn and other themes.

Hey @Money_Cooker

I recommend using iCart. It will allow you to add everything you mentioned. If you didn’t find what you’re searching for, contact their support team, they’ll help you.