Commmerce Docs
Short codes
Server-rendered {{scope.path}} tokens that resolve to live product, cart, order, and theme data. 224 tokens across 12 scopes.
Overview
Short codes are {{scope.path}} tokens you can drop directly into HTML, attribute values, JavaScript, or CSS. The server resolves them at render time, so the first painted frame already carries the real value — never the raw {{...}} placeholder. The catalog ships 224 tokens across 12 scopes.
Need the same UI inside the editor? Open the Topbar dropdown and pick Short Codes — the modal is backed by the exact same catalog you see here.
Scopes
Product Detail Page
36 tokens — {{pdp.*}}
Product Card (in loop)
15 tokens — {{product.*}}
Cart
5 tokens — {{cart.*}}
Checkout
22 tokens — {{checkout.*}}
Order
13 tokens — {{order.*}}
Category
5 tokens — {{category.*}}
Blog
8 tokens — {{blog.*}}
Header
4 tokens — {{header.*}}
Footer
8 tokens — {{footer.*}}
Store
11 tokens — {{store.*}}
Global Settings
86 tokens — {{settings.*}}
Store Preferences
11 tokens — {{preferences.*}}
How resolution works
- Server-side render — every token is replaced before HTML is streamed, so the browser never sees the placeholder.
- Page-binding aware — a token like
{{pdp.title}}only resolves on a PDP route; on other pages it stays untouched (or renders blank, depending on the consumer). - Loop tokens — tokens that start with
products[i],orders[i], etc. are evaluated inside their iterating component (e.g.<mmm-product-card>inside a loop). - Formatters — tokens carrying a formatter (
currency,number,boolean,html,url,date) emit the value in the canonical shape; raw access uses the.rawsuffix where available. - Composable — tokens may be combined inline (e.g.
title="Buy {{pdp.title}} for {{pdp.price}}") and survive HTML attribute escaping.