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.

/thankyou/12345
Header
thank-you:start
Order details
Title, order number, date and instructions
thank-you:items.start
Order items with shipments or the pickup branch
thank-you:items.end
Payment summary and invoice link
thank-you:payment.end
Loyalty points and cashback, next-order coupon, contact links
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 order details.none
thank-you:items.startAfter the title, order number and instructions, before the order items.none
thank-you:items.endAfter the order items and their shipments or pickup branch, before the payment summary.none
thank-you:payment.endAfter the payment summary, before the rewards and the next-order coupon.noneGood for a custom block that belongs with the order.
thank-you:endLast item on the page, after the contact links.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