Show your price list on your own website
Already have a website, a site builder or a headless shop front? Your Qrable price list can show there too, and it stays up to date: change a price in Qrable and every page that shows it changes with it.
Paste one snippet
For any website where you can paste HTML. Two lines, no coding.
<script src="…/app/plugins/satori-manifest/build/js/price-list-element.js" defer></script>
<manifest-price-list slug="harbour-kitchen"></manifest-price-list>
Replace harbour-kitchen with the end of your own Qrable page address.
Use the data
For developers and headless sites: read the price list as JSON, with or without the look you set up in Qrable, and build it your way.
GET …/wp-json/satori-manifest/v1/manifests/harbour-kitchen
Five ways to show it
Show everything, or only the part that belongs on that page of your site: the drinks on the bar page, the desserts on the dessert page.
| What you want | Snippet | Guide | Example |
|---|---|---|---|
| The whole menu | slug="harbour-kitchen" | How | See it |
| One or more headings (e.g. Main Menu) | heading="Main Menu" | How | See it |
| Every section, without headings | Data only | How | See it |
| Chosen sections (e.g. Starters, Mains) | section="Starters, Mains" | How | See it |
| A single section (e.g. Desserts) | section="Desserts" | How | See it |
The snippet's settings
| Setting | What it does |
|---|---|
slug | Required. The end of your Qrable page address, e.g. harbour-kitchen. |
heading | Only these headings, separated by commas. |
section | Only these sections, separated by commas. |
level | Title tag level, 1–5 (default 2), to fit your page's own headings. |
format | styled (default): looks as it does on your Qrable page, with your colours, fonts, design, menu layout and allergen icons. json: plain data with a neutral look, for websites that style it themselves. |
unstyled | With format="json": leave out the neutral look too. |
site | Only needed if the script is loaded from somewhere other than Qrable. |
Anything you put between the tags shows while the list loads, and stays if it can't load, so a link to your Qrable page is a good fallback:
<manifest-price-list slug="harbour-kitchen">
<a href="…/harbour-kitchen/">See our menu</a>
</manifest-price-list>
The look
By default the list looks as it does on your Qrable page: your brand colours and fonts, your design, each menu's layout (such as dotted leaders) and its switches (prices, descriptions, badges). Change them in Qrable and the list on your website follows. Everything also carries plain class names, so your website's CSS can adjust it.
| Class | Part |
|---|---|
.mpl-heading, .mpl-heading__title | A heading (e.g. Main Menu) and its title |
.mpl-section, .mpl-section__title | A section (e.g. Starters) and its title |
.mpl-item, .mpl-item__label, .mpl-item__price | A dish or product, its name and price |
.mpl-description, .mpl-badge | Descriptions and badges such as "Gluten free" |
.mpl-allergens, .mpl-allergen | Allergen icons |
For developers
- Address:
…{slug}.GETonly, no key or login. - Names: headings and sections match by title in any case (
Starters & Snacks,starters-snacks) or by id (s_1c66453c). Separate several with commas. - Hidden parts: headings or sections switched off in Qrable are never returned.
- Any website: CORS is open (
Access-Control-Allow-Origin: *, no cookies). - Caching:
ETag,Last-ModifiedandCache-Control: public, max-age=300; sendIf-None-Matchfor a304. - In JavaScript:
ManifestPriceList.load( slug, { heading, section, format } )returns the data;ManifestPriceList.render( data )builds the menu (styled when the data is).
Options on every request
| Option | Values | What it does |
|---|---|---|
format | json (default), styled | json gives the data only. styled gives the same data plus the look the client set up in Qrable: style (colours, fonts and CSS for every part), each heading's and section's own css, allergen icons and the allergen key. Always JSON. |
Errors
| Status | Code | When |
|---|---|---|
| 404 | rest_manifest_not_found | No published price list page with that slug. |
| 404 | rest_section_not_found | A single section was asked for and none matches. |
| 400 | rest_invalid_param | A bad option, e.g. format=xml. |
A filter that matches nothing (e.g. ?name=Nope) returns 200 with an empty list.
The styled response
With ?format=styled the same data comes with:
style:{ design, mode, colours, fonts: { heading, body: { family, url } }, css: { menu, heading, heading_title, sections, section, section_title, item, item_row, item_label, item_leader, item_price, item_description, badge, allergen, allergen_key, … } }. Eachcssvalue is a declaration string for that part.- Each heading:
csswith its own colours, photo and size. - Each section:
layoutandcssfrom the menu it sits in (layout, switches, fonts). Apply it afterstyle.css. - Each allergen:
icon(SVG). Plusallergen_key:{ title, note, items }. - Sections routes return
{ slug, name, style, sections, allergen_key }(orsectionfor one).
An item
{
"type": "item",
"label": "Harbour Cheesecake",
"description": "With ice-cream",
"price": "6.50",
"price_display": "6,50 €",
"price_prefix": "",
"badge": "",
"allergens": [ { "key": "milk", "label": "Milk", "colour": "#…" } ],
"image": null
}
An item with no price is a sub-heading inside its section. A photo row has "type": "image".