Thank you
The order confirmation page shown after a successful checkout.
Framework: TanStack Start
This page is written for TanStack Start, the default and currently supported framework. See what depends on the framework.
After a successful checkout, Salla sends the customer here. They see the order number and date, the store's message for the order, the order items with their shipments or pickup branch, the payment summary with an invoice link, any loyalty points or cashback the order earned, a next-order coupon and the store's contact links. Customise it to add your own message or upsell. Guests and signed-in customers both land on it.
URL
| Pattern | Example |
|---|---|
/{-$locale}/thankyou/$orderId | /thankyou/1234567, /ar/thankyou/1234567 |
The path is thankyou (one word), not thank-you, because the platform redirects to that form.
| Param | Type | Notes |
|---|---|---|
orderId | string | Passed to the order APIs as is. Not validated as a number. |
locale | string (optional) | ar in the example above |
There are no search params.
Route file
// @auto-generated
import { createFileRoute } from '@tanstack/react-router';
import { ThankYou } from '@salla.sa/twilight-theme-engine/routes/thank-you';
import type { ThankYouPageProps } from '@salla.sa/twilight-theme-engine/routes/thank-you';
import { withHead } from '@salla.sa/twilight-theme-engine/tanstack';
export const Route = createFileRoute('/{-$locale}/thankyou/$orderId')({
loader: ({ params }): Promise<ThankYouPageProps> =>
ThankYou.loader({ params: { orderId: params.orderId }, locale: params.locale }),
head: withHead(ThankYou),
component: ThankYouComponent,
});
function ThankYouComponent() {
const data: ThankYouPageProps = Route.useLoaderData();
return <ThankYou.Component {...data} />;
}To take the page over, delete the // @auto-generated line and edit the file. See Fork a built-in route.
A customised version
Add an extra store message by returning new messages from the loader's extend argument. The rest of the file stays as generated.
loader: ({ params }): Promise<ThankYouPageProps> =>
ThankYou.loader(
{ params: { orderId: params.orderId }, locale: params.locale },
(data) => ({ messages: [...(data.messages ?? []), 'Free gift wrapping on your next order'] })
),What it loads
The loader makes up to four requests together: the order, the same order in the shape the Salla web components read, the customer's loyalty points (only when the store has the loyalty program) and the customer's wallet. A request that fails is dropped instead of failing the page.
ThankYouPageProps has page ({ slug, id, title }) and, optionally:
| Prop | What it holds |
|---|---|
order | The order, when the customer may see it |
thank_you_title | The store's confirmation heading, from its settings |
instructions | The store's message for the order's status, as HTML |
messages | Extra lines shown under the instructions (empty unless you add some) |
items | The order lines: name, image, quantity, price and product link |
is_pickable | true for a pickup order: the page shows the branch instead of shipments |
created_at | When the order was placed, as an ISO date with the store's offset |
loyalty_points, loyalty_url | Points this order earns, and the loyalty page |
cashback, wallet_url | Cashback already credited for this order, and the wallet page |
share_message, short_share_message | Not filled by the loader; kept for themes that set them |
The page is built from the Salla web components <salla-thank-you-page>, <salla-thank-you-header>, <salla-order-shipments> or <salla-order-branch>, <salla-order-payment>, <salla-order-rewards>, <salla-next-order-coupon> and <salla-contacts>. It renders them in the browser only, after the page starts.
The head sets the title, description and language alternates. It sets no canonical or robots tag.
Edge cases
- Guest checkout. The page loads the order from
orders/{id}/thank-you, which lets a guest read it for 10 minutes after the order last changed (20 with thedeeplinkingheader), the same window as the Twig thank-you page. Past that window a guest'sorderisundefined: the page shows the title, the next-order coupon and the contact links, and hides the order number, items, payment summary and rewards. Rewards always need a signed-in customer. - Unknown order id. The order requests fail quietly, so the customer sees the same page as a guest, not a 404.
- Cashback. It reaches the wallet only once the order is completed, so a fresh order shows none.
- Instructions.
instructionsis rendered as HTML inside a paragraph, with scripts, frames, forms and event handlers removed.
See also
- Cart, where checkout starts
- Account order and Account orders
- Overview of every route