Skip to Content
StoreOSv0.31.0
ThemesContexts

Order confirmation

The order confirmation context in a StoreOS Fluid theme, with its route, widgets, the order object and an example widget.

The order confirmation context thanks the shopper after they place an order, and shows its number.

Route

/order-confirmation/:id

:id is the order's invoiceUID. Your checkout sends the shopper here after placing the order.

Widgets

The widgets listed under pages.order-confirmation in the theme document, or layout/order-confirmation.fluid.

{ "pages": { "order-confirmation": ["main-order-confirmation"] } }

Like checkout, give your theme this page: StoreOS's built-in one belongs to the catalog themes.

Data

ObjectContents
order.idThe order number from the URL
order.invoice_uidThe same number, for printing
page_titleOrder confirmation

Plus the data on every page. StoreOS never indexes this page: its SEO tags say noindex, nofollow.

The server only knows the order number. To show the items, totals or status, load the order in the browser with GET /api/v1/orders/:id from the Storefront REST API at shop.api_url, with the x-tenant header (shop.uid). It works signed out.

Example

{% comment %} widgets/main-order-confirmation.fluid {% endcomment %}
<section class="order-confirmation" data-order="{{ order.id }}">
  <h1>Thank you</h1>
  <p>Your order <strong>#{{ order.invoice_uid }}</strong> has been placed.</p>
  <p data-order-total></p>
  <a href="/collections/all">Continue shopping</a>
</section>

<script>
  (async () => {
    const { tenant, api } = JSON.parse(document.getElementById("store").textContent);
    const el = document.querySelector("[data-order]");
    const res = await fetch(`${api}/api/v1/orders/${encodeURIComponent(el.dataset.order)}`, {
      headers: { "x-tenant": tenant },
    });
    if (!res.ok) return;
    const order = await res.json();
    el.querySelector("[data-order-total]").textContent = `Total: ৳${order.netTotalAmount}`;
  })();
</script>

On this page