> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aftersell.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup walkthroughs

> Three short walkthroughs for setting up Aftersell Cart: strategy-driven upsells, per-market rewards, and custom styling with CSS and templates.

These three walkthroughs combine the main Aftersell Cart workflows end to end. Each step links to the reference page for full settings and rules.

Before publishing any cart to shoppers, make sure your store has granted the required permissions (**Update App** on the **Carts** page if prompted) and enabled the **Aftersell Cart app embed** in your theme — see [Creating carts](https://docs.aftersell.com/aftersell/cart/creating-carts.md).

## 1. First cart with strategy-driven upsells

Launch a draft cart that shows product offers from a Strategy, preview it, and publish it live.

1. **Create and name a cart.** On the **Carts** page, click **Create cart** to start from the default layout (`Header`, `Banner`, `Cart items`, `Summary`, and `Checkout button` in the filled state). Click the cart name in the editor's left sidebar to rename it — the name saves immediately. See [Creating carts](https://docs.aftersell.com/aftersell/cart/creating-carts.md).
2. **Add an Upsells block.** In the filled cart state, click **Add block** in the **Body** or **Footer** section (maximum 1 per cart state) and select **Upsells**. By default, Aftersell attaches **Shopify AI recommended products** so the block works straight away. See [How do blocks work?](https://docs.aftersell.com/aftersell/cart/blocks-overview.md) and [Upsells block](https://docs.aftersell.com/aftersell/cart/upsells-block.md).
3. **Create or attach a Strategy (optional).** To use your own rules instead of Shopify AI recommendations, open the block's **Strategy** picker and choose an existing Strategy, **Create strategy from selected products**, or **Create strategy from scratch**. In the Strategy editor:
   * Click the **pencil icon** to name the Strategy.
   * On a rule, click **Add trigger** (for example, **Cart subtotal** **Greater than** `50`, or a product **Collection** or **Tag(s)**), then set **Actions** such as **Specific products**, **Collection**, **Most popular**, or **AI Recommendations**.
   * Optionally enable **Catch all** as a fallback when no rule matches, and click the **filter icon** next to the Strategy name to add global filters such as **Exclude out of stock** or **Exclude input products**.
   * Save the Strategy (every rule needs at least one trigger or **Always match** and an action). If you opened the editor in a new tab via **••• → Edit strategy**, return to the cart editor tab and select the Strategy. See [Building Strategies](https://docs.aftersell.com/aftersell/strategies_building_in_app.md) and [Strategy rules reference](https://docs.aftersell.com/aftersell/strategies_rules_reference.md).
4. **Configure the Upsells settings.** Adjust **Title** (default `You may also like`), **Add button text** (default `Add`), **Layout** (**Carousel** or **List**), and **Maximum products** (`1`–`12`, default `4`). The entire Upsells section hides automatically when the Strategy returns no purchasable products. See [Upsells block](https://docs.aftersell.com/aftersell/cart/upsells-block.md).
5. **Save, preview, and publish.** Click **Save**, then click **Preview** to check the draft on a storefront theme with the app embed enabled. Click **Publish** when ready (requires the **Complete plan**; publishing a cart moves any current live cart back to draft). See [Previewing carts](https://docs.aftersell.com/aftersell/cart/previewing-carts.md) and [Creating carts](https://docs.aftersell.com/aftersell/cart/creating-carts.md).

## 2. Per-market Rewards block (free shipping + gift tiers)

Set up tiered spend rewards that unlock free shipping first and a free gift at a higher threshold, with separate tier sets by market, country, or currency.

1. **Add the Rewards block.** Open your draft cart, click **Add block** in the **Header**, **Body**, or **Footer** section (or in the empty cart state; maximum 1 per cart state), and select **Rewards**. See [How do blocks work?](https://docs.aftersell.com/aftersell/cart/blocks-overview.md) and [Rewards block](https://docs.aftersell.com/aftersell/cart/rewards-block.md).
2. **Set calculation and gift options.** Keep **Rewards calculation** on **Cart total (\$)**, which measures the qualifying items' subtotal before discounts (excluding tax, shipping, reward gifts, product add-ons, shipping protection, and gift cards). Leave **Stack rewards across tiers** on so shoppers keep free shipping after unlocking the gift tier, and choose whether **Add back removed free gifts** re-adds an earned gift if a shopper removes it. See [Rewards block](https://docs.aftersell.com/aftersell/cart/rewards-block.md).
3. **Order your conditions.** Under **Conditions**, each **When** card targets a **Shopify market**, **customer country**, or **customer currency** (**In** or **Not in**) and holds up to **4** tiers in its **Display** section. Because the **first matching condition wins** (and the block renders nothing if none match), keep specific market or country rules above the **All buyers** catch-all condition. See [Per-market rewards](https://docs.aftersell.com/aftersell/cart/rewards-block.md#per-market-rewards) and [Show or hide by market, country, or currency](https://docs.aftersell.com/aftersell/cart/blocks-overview.md#show-or-hide-by-market-country-or-currency).
4. **Add free shipping and free gift tiers.** Inside a condition's **Display** section:
   * For Tier 1, set **Reward type** to **Free shipping**, set **Threshold (\$)** (for example, `50`), and edit **Title before achieving tier** (supports `{{amount}}`) and **Progress bar label**.
   * Click **Add tier** for Tier 2, set **Reward type** to **Free gift**, set **Threshold (\$)** strictly greater than Tier 1 (for example, `100` — equal or lower thresholds block **Save**), and select up to **3** **Gift products**. Changing **Reward type** resets that tier's title and label to defaults, so customize the text afterward. See [Rewards block](https://docs.aftersell.com/aftersell/cart/rewards-block.md).
5. **Preview each condition and save.** Editor preview does not evaluate live buyer location, so select each condition card in the panel to inspect its tiers. Click **Save**, then verify in **Preview** (free gifts are added automatically when a cart crosses the threshold and removed if it drops below). See [Per-market rewards](https://docs.aftersell.com/aftersell/cart/rewards-block.md#per-market-rewards) and [Previewing carts](https://docs.aftersell.com/aftersell/cart/previewing-carts.md).

## 3. Styling a block or Custom code block with Custom CSS (and a custom template)

Start with built-in styling, then layer Custom CSS, a Custom code block, or a custom template only where needed.

1. **Try Design settings first.** Open **Cart settings** for global colors, buttons, horizontal padding, and desktop width, or use a block's own **Design** panel for per-block overrides (blank fields inherit global settings). Reach for Custom CSS only for styling those controls do not cover. See [Design settings](https://docs.aftersell.com/aftersell/cart/design-settings.md).
2. **Add a Custom code block (if you need new markup).** When no built-in block fits, click **Add block** to place a **Custom code** block in a section (or inside **Cart items** to repeat per line), then open its **Code** tab. Write **HTML** (tokens like `{{savings_amount}}` work; inline `<script>` tags do not run) or a **React component** (click **Compile** after editing). Give elements a public or store-prefixed class (for example, `cart-external-custom-code_html`), turn on **"Use custom template"**, and keep the sidebar eye toggle on. See [Custom code blocks](https://docs.aftersell.com/aftersell/cart/custom-code-blocks.md).
3. **Use a custom template on an existing block (when layout changes are needed).** If a built-in block needs different markup, open its **Code** tab, edit the JSX body inside the locked function signature (or use **Copy AI prompt**; **Reset to default** restores the starter markup), click **Compile**, and turn the template on (a green `</>` icon appears in the sidebar). An active custom template replaces the block's wrapper and **disables its Design tab**: keep `cart-internal-*` and `cart-external-*` classes for small tweaks, or drop **both** and use your own store-prefixed class names if you restructure the DOM. See [Custom templates](https://docs.aftersell.com/aftersell/cart/custom-templates.md).
4. **Add rules in Custom CSS.** Open **Cart settings → Custom CSS**, which loads after the cart's base styles. Style built-in blocks through their public **`cart-external-*`** classes (or your own store-prefixed classes on restructured templates and Custom code blocks). Avoid `cart-internal-*` classes (the editor flags them as errors) and selectors aimed outside the drawer (the cart renders inside a **shadow DOM**, so styles are scoped to the drawer). See [Custom CSS](https://docs.aftersell.com/aftersell/cart/custom-css.md).
5. **Verify in preview before publishing.** Because compile and runtime errors in custom templates and Custom code blocks fail silently, check both **Filled cart** and **Empty cart** in the editor canvas (and use **Cart items → Preview → Sample data** to test standard, long-title, bundle, and subscription lines), then click **Save** and check storefront **Preview**. See [Previewing carts](https://docs.aftersell.com/aftersell/cart/previewing-carts.md).
