> For the complete documentation index, see [llms.txt](https://docs.samita.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samita.io/samita-countdown-timer-bar/cart-countdown/create.md).

# Create a cart countdown

Build a cart timer end to end, from message and duration to a live cart page.

This guide builds a complete cart countdown: a message with a running timer, a duration, a style, and an action for when the clock runs out.

Make sure the [app embed is on](/samita-countdown-timer-bar/quick-start/enable-app-embed.md) before you start.

## Steps to set it up

{% stepper %}
{% step %}

### Create the countdown

Click **Create countdown** from the dashboard or the **Countdowns** page.
{% endstep %}

{% step %}

### Pick the Cart countdown layout

On the **Countdown templates** page, switch the type tab to **Cart countdown** and click **Select** on the default layout.
{% endstep %}

{% step %}

### Name it

Something like "Cart hold — 10 minutes".
{% endstep %}

{% step %}

### Write the message

On the **Settings** tab, open **Content** and edit the **Message**. A new cart countdown starts with:

> 🔥 Hurry up! Your cart will be lost in {timer} !!

`{timer}` is replaced with the running clock. Keep it in the sentence — without it there's no countdown, just a warning.

{% hint style="info" %}
Say what will actually happen. If you've set the expiry action to leave the cart alone, "your cart will be lost" isn't true. "Complete your order within {timer}" promises nothing you don't deliver.
{% endhint %}

<figure><img src="https://855148666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaOJwtwIUCsbYLCDqZD0u%2Fuploads%2Fgit-blob-a0ee736bbd72d6d278135917e2a572cae32412ea%2Fscreenshot-cart-message.png?alt=media" alt="The cart countdown Message field with the timer variable in the text"><figcaption><p>{timer} renders the running clock inside your message.</p></figcaption></figure>
{% endstep %}

{% step %}

### Set the duration

Still in **Content**, set **Countdown duration** in minutes. The default is 10.

Long enough for a shopper to finish checking out without feeling chased, short enough to matter. Most stores land between 10 and 20 minutes.
{% endstep %}

{% step %}

### Style it

Use the design controls in the **Settings** tab to set the position, colors for the message, timer and background, borders, and fonts. A cart countdown doesn't have a separate Design tab — its options live here.

The message sits at the top of the cart, so it's worth keeping it visually quieter than your checkout button.
{% endstep %}

{% step %}

### Choose what happens at zero

Switch to the **Display** tab. For a cart countdown, this tab carries **Action after time expired**:

* **Go to the homepage without clearing cart** — the default
* **Hide the message and do nothing**
* **Clear the cart and redirect to** — with a URL field

Pick carefully: one of these deletes the shopper's cart. See [When the cart timer expires](/samita-countdown-timer-bar/cart-countdown/when-time-expires.md) before choosing.

<figure><img src="https://855148666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaOJwtwIUCsbYLCDqZD0u%2Fuploads%2Fgit-blob-edc7fbfcfab75f9a089ddefebdd2c83b4a582955%2Fscreenshot-cart-action-expired.png?alt=media" alt="The Action after time expired options on the Display tab of a cart countdown"><figcaption><p>The Display tab of a cart countdown carries the expiry action.</p></figcaption></figure>
{% endstep %}

{% step %}

### Set conditions if you need them

The **Conditions** section still applies — you can restrict the cart countdown by customer, language, or country, for instance. Leave it as it is to show the timer on every cart. See [Display conditions](/samita-countdown-timer-bar/where-countdowns-appear/conditions.md).
{% endstep %}

{% step %}

### Save it as Active

Set the status to **Active** and click **Save**.
{% endstep %}

{% step %}

### Check it on your storefront

Add something to your cart on your live storefront and open the cart page. The timer should be at the top, counting down from your duration.

Open your cart drawer too, if your theme has one — the countdown appears there as well.

Then check the empty case: remove everything from the cart. With no items, the countdown correctly doesn't appear.
{% endstep %}

{% step %}

### Watch it expire once

Let a timer run all the way down in a private browser window and confirm the expiry action does what you expect — especially if you chose **Clear the cart and redirect to**. It's much better to discover a surprise here than in a support ticket.
{% endstep %}
{% endstepper %}

## Next steps

* [When the cart timer expires](/samita-countdown-timer-bar/cart-countdown/when-time-expires.md)
* [Cart countdown overview](/samita-countdown-timer-bar/cart-countdown/overview.md)
* [Display conditions](/samita-countdown-timer-bar/where-countdowns-appear/conditions.md)
* [Countdown not showing](/samita-countdown-timer-bar/help/countdown-not-showing.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.samita.io/samita-countdown-timer-bar/cart-countdown/create.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
