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
| Object | Contents |
|---|---|
order.id | The order number from the URL |
order.invoice_uid | The same number, for printing |
page_title | Order 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>Checkout
The checkout context in a StoreOS Fluid theme, with its route, widgets, data, how to place an order from the browser, and an example widget.
Shopper pages
Account, sign-in, orders, profile, cart, wishlist and order tracking in a StoreOS Fluid theme, and how to load the shopper's data in the browser.