Cart and checkout slots

Where the cart page, its order summary and the thank-you page expose slots, and what each one receives.

Use these slots when you want a free-shipping message above the cart lines, a note beside the checkout button, or an upsell on the order-confirmation page, without forking the route. New to slots? Read Slots and Page frame slots first.

Cart page

Route: Cart. The cart slots render only when the cart has items. An empty cart shows an empty state, and none of them appear.

/cart
Header
Breadcrumb and offer banner
cart:start
cart:items.startcontext: cartItems
Cart lines, options and offers
cart:items.end
cart:summary.start
Free-shipping bar, coupon and totals
cart:submit.start
Complete order button
cart:submit.end
cart:summary.end
cart:end
Footer
Slot: add your content hereDrawn by the engine
Cart page (with items)
SlotPositionContextNotes
cart:startAfter the breadcrumb and conditional offer, before the two-column layout. Full width.noneGood for a banner above everything.
cart:items.startAt the top of the left column, before the first cart line.cartItemscartItems is the array of cart lines.
cart:items.endAt the bottom of the left column, after the cart lines, product options and offers.none
cart:summary.startAt the top of the order summary (right column), before the free-shipping bar.noneThe summary is sticky on large screens.
cart:submit.startDirectly before the "Complete Order" button.none
cart:submit.endDirectly after the "Complete Order" button.noneGood for payment icons or a returns note.
cart:summary.endAt the bottom of the order summary, after the checkout button.noneThe tiered-offer widget renders below this slot.
cart:endAfter the two-column layout, at the bottom of the page container.noneFull width.

cart:items.start is the only cart slot with its own context: { cartItems }. The other slots pass nothing. Every handler also receives twilight, so cart:items.start handlers get { cartItems, twilight }.

Example: free-shipping banner above the cart items

app/hooks/index.tsx
import { hookRegistry, HookName, type HookContext } from '@salla.sa/twilight-theme-engine/hooks';

export function registerThemeHooks() {
  hookRegistry.register(
    HookName.CART_ITEMS_START,
    (context: HookContext) => {
      const { cartItems } = context as { cartItems?: unknown[] };
      if (!cartItems?.length) return null;
      return (
        <div className="mb-4 rounded-md bg-gray-100 p-3 text-sm">
          {cartItems.length} item(s) in your cart. Orders over 200 SAR ship free.
        </div>
      );
    },
    50
  );
}

Call registerThemeHooks() once at module scope, as in Add content to a slot.

Thank-you page

Route: Thank you. The customer lands here after placing an order.

/thank-you/12345
Header
thank-you:start
Header band
Breadcrumb, title, order number and view-order button
Instructions and messages
thank-you:items.start
thank-you:items.end
Next-order coupon and pickup branch
Order summary and contact details
thank-you:end
Footer
Slot: add your content hereDrawn by the engine
Thank-you page
SlotPositionContextNotes
thank-you:startFirst thing on the page, above the colored header band.none
thank-you:items.startIn the confirmation block, after the order number, instructions and messages.none
thank-you:items.endImmediately after thank-you:items.start.noneThe two slots are adjacent with nothing between them, so they render back to back. They always render.
thank-you:endLast item inside the page container, after the contact details.noneGood for a "follow us" or referral block.

None of the thank-you slots pass the order in their context. If you need order data, load it yourself in your handler's component.

Next

On this page