Prices and availability
How to show a live price, and whether rooms are free, in your site’s own HTML. Each section is one thing you may want to show, with the shortest markup that does it.
Everything here needs only the script tag. Every price comes from the same availability the booking window reads, for the same stay and party. The ids in the examples are placeholders: data-room and data-plan take the property’s own ids — see Room type and rate plan ids.
One price in a sentence
data-pms-text on any element of yours prints one live value. Name the room with data-room and the stay on the same element.
<p> The Garden Suite this weekend: <span data-pms-text="price" data-room="00000000-0000-0000-0000-000000000000" data-stay="weekend">from €240</span></p>What you write inside is your fallback. It shows until the value arrives, and it comes back whenever there is no value for the stay the element asks for: the answer is on its way, the request failed, or the room cannot be sold for that stay. So write words that read well by themselves.
| Attribute | Values | What it does |
|---|---|---|
data-pms-text | a field name — see the lists below | Replaces the text of the element with one live value. What you wrote inside stays until the value arrives, and comes back whenever there is no value for the stay the element asks for now: the answer still on its way, a failed request, a room that cannot be sold. |
data-room | room type id | The room the value belongs to. Needed for a room's value. |
data-stay | "tomorrow" | "weekend" | "search" | The stay the value is priced for. search: the dates and the party of the search form on the page — the form the element is inside, else the page's first form with a data-pms-dates or data-pms-guests button, else its first ready search form. The value is priced once the search is complete — both dates, an age for every child — and the guest has stopped changing it; until then your own text stands. |
data-check-in, data-check-out | YYYY-MM-DD | Or exactly these dates. With neither: one night from tomorrow. With data-stay="search": the dates priced until the search is complete. |
data-plan | rate plan id | The price of this rate plan only. Left out: the room's lowest price. |
price is the room’s lowest price for the stay, over the rate plans that can be paid for online. With data-plan it is the price of that plan only.
The cheapest room for a stay
Leave data-room out and ask for fromPrice: the price of the stay in the cheapest room that can be sold. With data-plan, the cheapest on that rate plan.
<p> Rooms this weekend <span data-pms-text="fromPrice" data-stay="weekend">at our best rate</span> for the stay</p>| Field | What it prints |
|---|---|
fromPrice | The price of the stay in the cheapest room that can be sold, formatted: €102.00. |
fromPricePerNight | That price divided by the nights. |
checkIn | The arrival date, YYYY-MM-DD — or as data-format says. |
checkOut | The departure date, YYYY-MM-DD — or as data-format says. |
nights | The length of the stay in words: 2 nights. |
checkIn, checkOut and nights are printed with no room named only when a stay is named — on the element itself, or on the data-pms-if element it sits in. A bare data-pms-text="checkIn" outside a search form is left alone.
A price per night
pricePerNight for a room, fromPricePerNight with no room named. Both are the price of the stay divided by its nights, so taxes charged on top are in them too.
<span data-pms-text="fromPricePerNight" data-stay="weekend">from €95</span> a night
<span data-pms-text="pricePerNight" data-room="00000000-0000-0000-0000-000000000000" data-stay="weekend">from €120</span> a nightFor which stay and which party
A price is always for one stay and one party. Both are written on the element that prints it.
<!-- a named stay, counted from the visitor's today --><span data-pms-text="fromPrice" data-stay="tomorrow">ask us</span><span data-pms-text="fromPrice" data-stay="weekend">ask us</span>
<!-- exact dates; check-out is the day of departure --><span data-pms-text="fromPrice" data-check-in="2026-12-24" data-check-out="2026-12-27">ask us</span>
<!-- two adults and two children, aged 6 and 9 --><span data-pms-text="fromPrice" data-stay="weekend" data-adults="2" data-child-ages="6,9">ask us</span>| Attribute | Values | What it does |
|---|---|---|
data-stay | "tomorrow" | "weekend" | "search" | The stay the value is priced for. search: the dates and the party of the search form on the page — the form the element is inside, else the page's first form with a data-pms-dates or data-pms-guests button, else its first ready search form. The value is priced once the search is complete — both dates, an age for every child — and the guest has stopped changing it; until then your own text stands. |
data-check-in, data-check-out | YYYY-MM-DD | Or exactly these dates. With neither: one night from tomorrow. With data-stay="search": the dates priced until the search is complete. |
data-adults | 1–20 — default 2 | The party it is priced for. |
data-child-ages | ages 0–17, comma-separated | The children it is priced for, one age per child. The list counts only whole: with an entry that is not a whole number from 0 to 17, with more than eight ages, or with a child the property books as an adult, it is ignored and the party is the adults alone. |
- With no stay named, the price is for one night from tomorrow.
- With no party named, it is for two adults.
- A fixed date in markup goes stale. Prefer a named stay, or follow the search form.
- A child is priced by its real age. A list of ages counts only whole: one bad entry, or one child the property books as an adult, drops every child, and the price is for the adults alone — see Children.
- When a stay attribute changes while the page is open — a framework swaps
data-check-in, say — the value is priced again by itself. The old value is removed at once; your own text stands until the new one arrives.
A price that follows the search form
data-stay="search" on a value, a rooms repeat or a data-pms-book link takes the dates and the party from the search form on the page.
<form class="stay-search" method="get" action="/booking"> <button type="button" class="stay-field" data-pms-dates> <span data-pms-text="checkIn">Check-in</span> – <span data-pms-text="checkOut">Check-out</span> </button> <button type="button" class="stay-field" data-pms-guests> <span data-pms-text="guests">2 adults</span> </button> <button class="stay-go">Search</button></form>
<p class="rate"> The Garden Suite for your dates: <span data-pms-text="price" data-room="00000000-0000-0000-0000-000000000000" data-stay="search">pick your dates</span> <a href="/booking" data-pms-book data-room="00000000-0000-0000-0000-000000000000" data-stay="search">Book it</a></p>
<div class="rooms"> <template data-pms-each="rooms" data-stay="search"> <a class="room" href="{{bookUrl}}"> <h3>{{name}}</h3> <p data-pms-if="available">{{price}} for {{nights}}</p> <p data-pms-if="!available">Not on these dates</p> </a> </template></div>/* a price on its way: your own words, quieter */[data-pms-loading] { opacity: 0.5;}| Attribute | Values | What it does |
|---|---|---|
data-stay | "tomorrow" | "weekend" | "search" | The stay the value is priced for. search: the dates and the party of the search form on the page — the form the element is inside, else the page's first form with a data-pms-dates or data-pms-guests button, else its first ready search form. The value is priced once the search is complete — both dates, an age for every child — and the guest has stopped changing it; until then your own text stands. |
data-check-in, data-check-out | YYYY-MM-DD | Or exactly these dates. With neither: one night from tomorrow. With data-stay="search": the dates priced until the search is complete. |
data-stay | "tomorrow" | "weekend" | "search" | The stay the rooms are priced for. search: the dates and the party of the search form on the page, chosen as for a value; every bookUrl carries them. No card is drawn until the search is complete. |
data-stay | "tomorrow" | "weekend" | "search" | A stay counted from the visitor's today. tomorrow: one night from tomorrow. weekend: the coming Friday to Sunday — on a Saturday, that Saturday to Sunday. search: the dates and the party of the search form on the page — the form the link is inside, else the page's first form with a data-pms-dates or data-pms-guests button, else its first ready search form. The address follows every pick; while the search is not complete it carries no dates. |
data-pms-loading | no value | Present on a value, a rooms template or an element with data-pms-if while its answer is on the way. Removed when the answer has landed or the request has failed. |
data-pms-text | a field name — see the lists below | Replaces the text of the element with one live value. What you wrote inside stays until the value arrives, and comes back whenever there is no value for the stay the element asks for now: the answer still on its way, a failed request, a room that cannot be sold. |
data-room | room type id | The room the value belongs to. Needed for a room's value. |
data-pms-book | no value | Makes the element a way into the booking. An <a> gets its href; any other element goes there on click. |
data-pms-each | "rooms" | Repeats what is inside the template once per room type, right after the template. |
data-pms-if | "available" | "scarce" | a field | field=text — with "!" in front for the opposite | Keeps the element only when the room can be sold for the stay (available), when 1 to 3 are left (scarce), or when the named field has a value. One comparison is allowed, equality: reasonKind=min-stay holds when the field prints exactly that text. With ! in front: the opposite of the whole test. Inside a list, a field of that row counts too. Otherwise the element is left out — inside a template it is removed, not hidden. |
data-pms-dates | no value | "check-out" | Opens our calendar when pressed. With the value check-out it opens on the check-out date. |
data-pms-guests | no value | Opens our guests panel under the element. |
- Which form. The form the element is inside; else the page’s first form with a
data-pms-datesordata-pms-guestsbutton; else its first ready search form. With no search form on the page the element keeps your own text. - When it is priced. Only for a complete search — both dates, and an age for every child — and about half a second after the guest stops changing it.
- Until then. Your own text stands, a repeat draws no card and a link carries no dates. If the element also has
data-check-inanddata-check-out, those dates are priced meanwhile, with the element’s own party. - When the search changes. The price before is removed at once — never the last stay’s price under new dates — and the element carries
data-pms-loadinguntil the new one is in. - The party is the form’s.
data-adultsanddata-child-ageson the element are not read once the search is complete.data-planstays the element’s own. - The link. Its address follows every pick. A card’s
bookUrland a following link carry exactly the stay and party the price was asked for.
data-stay="search" works on your own elements only. The ready book button and offer table do not take it, and neither does rooms(): from JavaScript, read the form with getSearch() and pass its dates on — see JavaScript.
A card per room, with its rate plans
A <template data-pms-each="rooms"> is repeated once per room type, right after itself. Inside it, <template data-pms-each="plans"> repeats over that room’s rate plans.
<div class="rooms"> <template data-pms-each="rooms" data-stay="weekend"> <article class="room"> <h3>{{name}}</h3> <p data-pms-if="available">from {{pricePerNight}} a night · {{price}} for {{nights}}</p> <p data-pms-if="!available">{{reason}}</p> <ul> <template data-pms-each="plans"> <li>{{name}} — {{price}} <a href="{{bookUrl}}">Book</a></li> </template> </ul> </article> </template></div>| Attribute | Values | What it does |
|---|---|---|
data-pms-each | "rooms" | Repeats what is inside the template once per room type, right after the template. |
data-stay | "tomorrow" | "weekend" | "search" | The stay the rooms are priced for. search: the dates and the party of the search form on the page, chosen as for a value; every bookUrl carries them. No card is drawn until the search is complete. |
data-check-in, data-check-out | YYYY-MM-DD | Or exactly these dates. With neither: one night from tomorrow. With data-stay="search": the dates priced until the search is complete. |
data-adults | 1–20 — default 2 | The party they are priced for. |
data-child-ages | ages 0–17, comma-separated | The children they are priced for, one age per child; every bookUrl carries them. The list counts only whole: with an entry that is not a whole number from 0 to 17, with more than eight ages, or with a child the property books as an adult, it is ignored and the party is the adults alone. |
data-plan | rate plan id | Prices of this rate plan only; rooms it does not sell are left out. |
data-rooms | room type ids, comma-separated | Only these rooms, in this order. |
data-limit | a whole number above 0 | At most this many rooms. |
{{field}} | a room field | Replaced by the room's value, in text and in attribute values; a name that is not a field is left as written. Never filled, braces left as you wrote them: an event handler (onclick and every other on…), style, srcdoc, and anything in a <script> or <style> element. An address (href, src, srcset, action, formaction, poster, data, ping) is filled, and removed if it would then be anything but a relative or http(s) address. |
data-pms-if | "available" | "scarce" | a field | field=text — with "!" in front for the opposite | Keeps the element only when the room can be sold for the stay (available), when 1 to 3 are left (scarce), or when the named field has a value. One comparison is allowed, equality: reasonKind=min-stay holds when the field prints exactly that text. With ! in front: the opposite of the whole test. Inside a list, a field of that row counts too. Otherwise the element is left out — inside a template it is removed, not hidden. |
data-pms-each="plans" | Repeats over the room's rate plans — only the named one when the rooms template has data-plan. | |
data-pms-item | no value | Marks every element a repeat added. |
data-pms-available | "true" | "false" | Whether that room can be sold for the stay: it has a rate plan for it that can be paid for online. |
- Inside a template
data-pms-ifremoves the element when the test does not hold. It does not usehiddenthere, so do not writehiddenon it: an element that is kept stays hidden. - A room that cannot be sold still gets a card, with
data-pms-available="false", an emptypriceand a reason. Withdata-planon the rooms template, rooms that plan does not sell are left out. - The cards are drawn again when a stay attribute of the template changes; the cards of the stay before are removed at once.
- If the prices cannot be read, no card is drawn. Put your own fallback beside the template.
The full worked card — photographs, amenities, a badge — is on Offer prices.
Fields of a room
For {{…}}, data-pms-if and data-pms-text in a rooms template, and for data-pms-text or data-pms-if together with data-room anywhere.
| Field | What it prints |
|---|---|
name | The room type's name, in the page's language. |
description | Its description as the hotel wrote it. It may hold Markdown marks. |
photo | The address of its first photograph. Empty when it has none. |
amenities | Its amenities' names, comma-separated. |
area | Its size in m², as a number. Empty when not set. |
maxGuests | The most guests it takes. |
left | How many of this room are left for the stay. Empty when the room cannot be sold. |
minStay | The minimum stay in nights — known only when the room is refused for this stay for being too short. Empty otherwise: a room on sale states none. |
reasonKind | Why the room cannot be sold for the stay, as one word for your CSS and for data-pms-if: party (more guests than it takes), sold-out, closed, no-arrival, no-departure, min-stay, max-stay, stay-length, min-advance, max-advance, or other. Empty when it can be sold. |
reason | The same, as the sentence the booking window shows for it, in the page's language: Minimum stay 4 nights for these dates. Empty when the room can be sold. |
maxStay | The maximum stay in nights — known only when the room is refused for this stay for being too long. Empty otherwise. |
minAdvance | How many days ahead the room must be booked — known only when it is refused for being booked too late. Empty otherwise. |
maxAdvance | How many days ahead at most the room can be booked — known only when it is refused for being booked too early. Empty otherwise. |
stayLengths | The only lengths of stay the room takes from this arrival, in nights, comma-separated: 3, 5, 7 — known only when it is refused for that. Empty otherwise. |
price | The price of the stay, formatted in the property's currency — the whole price the booking page charges: VAT and city tax charged on top of the room rate are already in it. Empty when the room cannot be sold. |
pricePerNight | That price divided by the nights. |
priceAmount | That price as a plain number in the property's currency: 306. Empty when the room cannot be sold. Do not convert it: the guest is charged in that currency. |
vatAdded | The VAT charged on top of the room rate, formatted — on the rate plan the price is for. It is already inside price: never add it. Empty when the rate includes VAT. |
cityTax | The city tax collected on top of the room rate, formatted. It is already inside price: never add it. Empty when the rate includes it or there is none. |
taxes | The one line the booking window prints about taxes charged on top: VAT added · + €6.00 city tax. Empty when nothing is charged on top. |
depositPercent | The percent of the booking that rate plan asks for at booking, as a number: 30. Empty when its deposit is not a percent — a fixed amount, a number of nights, or none. |
currency | The currency code: EUR. |
nights | The length of the stay in words: 2 nights. |
checkIn | The arrival date, YYYY-MM-DD — or as data-format says. |
checkOut | The departure date, YYYY-MM-DD — or as data-format says. |
checkInDay | The day of the month, with no leading zero: 8. |
checkInMonth | The month's name: December. |
checkInMonthShort | The month's short name: Dec. |
checkInWeekday | The weekday's name: Tuesday. |
checkInYear | The year: 2026. |
checkOutDay | The day of the month, with no leading zero: 8. |
checkOutMonth | The month's name: December. |
checkOutMonthShort | The month's short name: Dec. |
checkOutWeekday | The weekday's name: Tuesday. |
checkOutYear | The year: 2026. |
bookUrl | The address of your booking page with this stay and room — and the priced rate plan, when the room can be sold. |
id | The room type's id. |
roomId | The room type's id — the same as id, and still the room's inside a list of plans. |
roomName | The room type's name — the same as name, and still the room's inside a list of plans. |
Fields of a rate plan
Inside <template data-pms-each="plans">. The room’s own fields stay readable there; a plan’s field of the same name wins, and roomName and roomId always mean the room.
| Field | What it prints |
|---|---|
name | The rate plan's name. |
description | The plan's own description. Empty when it has none. |
price | The stay's price on this plan, formatted — the whole price the booking page charges, taxes charged on top included. |
pricePerNight | That price divided by the nights. |
priceAmount | That price as a plain number in the property's currency. Do not convert it. |
deposit | What is paid at booking, formatted. Empty when the plan asks for nothing up front. When and how the rest is paid is in the plan's terms — do not state it yourself. |
depositPercent | The percent of the booking the plan asks for at booking, as a number: 30. Empty when its deposit is not a percent. |
vatAdded | The VAT charged on top of the room rate, formatted. It is already inside price: never add it. Empty when the rate includes VAT. |
cityTax | The city tax collected on top of the room rate, formatted. It is already inside price: never add it. Empty when the rate includes it or there is none. |
taxes | The one line the booking window prints about taxes charged on top: VAT added · + €6.00 city tax. Empty when nothing is charged on top. |
cancellation | The cancellation terms in one line — dated for this arrival when the engine dates them. Empty when the plan states none. |
includes | What the rate includes, the names joined with commas. Empty when it states none. |
bookUrl | The address of your booking page with this stay, this room and this plan. |
id | The rate plan's id. |
index | The row's number in the list, from 1. |
Show something only when rooms are free
data-pms-if on any element of yours shows or hides it by the live answer for the stay written on it. It sets and removes the hidden attribute; it never removes the element.
<p class="banner" data-pms-if="available" data-room="00000000-0000-0000-0000-000000000000" data-stay="weekend" hidden> The Garden Suite is free this weekend: <span data-pms-text="price">ask us</span> for <span data-pms-text="nights">the stay</span>. <a href="/booking" data-pms-book>Book it</a></p>
<p class="banner" data-pms-if="!available" data-stay="weekend" hidden> We are full this weekend.</p>| Attribute | Values | What it does |
|---|---|---|
data-pms-if | "available" | "scarce" | a field | field=text — with "!" in front for the opposite | Shows the element when the test holds and hides it when it does not. available: with data-room, that room can be sold for the stay; with none, some room can. With data-room also scarce (1 to 3 left) and any field of a room — it holds when the field has a value. With no data-room, the fields of a stay. One comparison is allowed, equality: reasonKind=min-stay holds when the field prints exactly that text. With ! in front: the opposite of the whole test. |
data-room | room type id | The room the test is about. Left out: the test is about the stay as a whole. |
data-stay | "tomorrow" | "weekend" | "search" | The stay the test is asked for. search: the dates and the party of the search form on the page, chosen as for a value — until that search is complete the element stays as you wrote it. |
data-check-in, data-check-out | YYYY-MM-DD | Or exactly these dates. With neither: one night from tomorrow. With data-stay="search": the dates asked for until the search is complete. |
data-adults | 1–20 — default 2 | The party it is asked for. |
data-child-ages | ages 0–17, comma-separated | The children it is asked for, one age per child. The list counts only whole: with an entry that is not a whole number from 0 to 17, with more than eight ages, or with a child the property books as an adult, it is ignored and the party is the adults alone. |
data-plan | rate plan id | Asks about this rate plan only: available means the room is sold on it. |
data-pms-text | a field name — see the lists below | Replaces the text of the element with one live value. What you wrote inside stays until the value arrives, and comes back whenever there is no value for the stay the element asks for now: the answer still on its way, a failed request, a room that cannot be sold. |
data-pms-book | no value | Makes the element a way into the booking. An <a> gets its href; any other element goes there on click. |
data-pms-loading | no value | Present on a value, a rooms template or an element with data-pms-if while its answer is on the way. Removed when the answer has landed or the request has failed. |
Write hidden on it. The script acts only on a definite answer. While the answer is on its way, when the request fails, when the search it follows is not complete, or when data-room names a room the property does not list, the element stays exactly as you wrote it. So an element written hidden appears only on a definite yes, and “We are full” is never shown because of an error.
Your CSS can defeat hidden. The browser hides a hidden element with a weak rule of its own. Any rule of your site that sets display on the element — .banner { display: flex; } — wins over it, and the banner shows whatever the script decided. Add this once to your stylesheet:
[hidden] { display: none !important;}What the test may be:
available— withdata-room, that room can be sold for the stay; with no room, some room can. A room can be sold when it has a rate plan for the stay that can be paid for online.- With
data-room:scarce(1 to 3 left), or any field of a room — it holds when the field has a value. - With no
data-room: the fields of a stay —fromPrice,fromPricePerNight,checkIn,checkOut,nights. - One comparison, equality:
data-pms-if="reasonKind=min-stay". No quotes around the text. !in front for the opposite of the whole test.- A name that is not a field does nothing: the element stays as written, and the console says so once.
A data-pms-text or a data-pms-book inside the element uses its stay and party, its data-room and its data-plan, unless it names its own. One that names any of data-stay, data-check-in, data-check-out, data-adults or data-child-ages uses all five of its own.
With data-stay="search" the line follows your search form:
<p data-pms-if="available" data-stay="search" hidden> Rooms for your dates from <span data-pms-text="fromPrice">our best rate</span></p><p data-pms-if="!available" data-stay="search" hidden>Nothing is free for these dates.</p>Why a room cannot be booked
A room that cannot be sold for the stay says why, in two fields:
reason— the sentence the booking window shows for it, in the page’s language: “Minimum stay 4 nights for these dates”.reasonKind— the same as one word, for your CSS and fordata-pms-if:party,sold-out,closed,no-arrival,no-departure,min-stay,max-stay,stay-length,min-advance,max-advanceorother.
Both are empty when the room can be sold.
<template data-pms-each="rooms" data-stay="search"> <article class="room {{reasonKind}}"> <h3>{{name}}</h3> <p data-pms-if="available">{{price}} for {{nights}}</p> <p data-pms-if="!available"> {{reason}}<span data-pms-if="reasonKind=min-stay"> — add nights to make it {{minStay}}</span> </p> </article></template>Outside a template, for one room:
<p data-pms-if="reasonKind=sold-out" data-room="00000000-0000-0000-0000-000000000000" data-stay="weekend" hidden> The Garden Suite is taken this weekend.</p>- The figures —
minStay,maxStay,minAdvance,maxAdvance,stayLengths— are filled only for the restriction that refused this stay. A room on sale states none of them. - The comparison is exact, against what the field prints:
reasonKind=min-stay,minStay=4. Spaces around=are ignored.nightsprints words, so it isnights=3 nights, notnights=3. othercovers everything without a kind of its own — a room with no rate plan that can be paid for online, or a nameddata-planthe room is not sold on.- Prefer
{{reason}}to a sentence of your own: it is the booking window’s wording, so the two pages agree.
Taxes and what is paid at booking
price is already the whole price: the VAT and the city tax charged on top of the room rate are inside it.
<template data-pms-each="plans"> <li> {{name}} — <strong>{{price}}</strong> <small data-pms-if="taxes">The price includes: {{taxes}}</small> <small data-pms-if="deposit">{{deposit}} due at booking</small> </li></template>vatAddedandcityTaxare a breakdown ofprice. Never add them to it. Each is filled only when that tax is charged on top of the room rate, and empty otherwise.taxesis the one line the booking window prints about them — “VAT added · + €6.00 city tax” — and empty when nothing is charged on top.depositis what is paid at booking, formatted; empty when the plan asks for nothing up front.depositPercentis the percent as a number, filled only when the deposit is a percent.priceAmountis the price as a plain number in the property’s currency. Do not convert it, and do not do arithmetic with it to print another price.- On a room,
vatAdded,cityTax,taxesanddepositPercentare those of the rate plan its price is for.
Do not say when or where the rest is paid. That is in the plan’s terms, and it is not the same for every plan — see What is not available.
While the answer is on the way
A value, a rooms template and an element with data-pms-if carry data-pms-loading while their answer is on the way. It is removed when the answer has landed or the request has failed. A value shows your own text meanwhile, so the page always reads.
/* a price on its way: your own words, quieter */[data-pms-loading] { opacity: 0.5;}/* a value still in your own words */[data-pms-text]:not([data-pms-filled]) { color: #9b9484;}| Attribute | Values | What it does |
|---|---|---|
data-pms-loading | no value | Present on a value, a rooms template or an element with data-pms-if while its answer is on the way. Removed when the answer has landed or the request has failed. |
data-pms-filled | no value | Present while a value the script wrote stands in the element; never while your own text does. It is removed again when your own words come back. |
data-pms-item | no value | Marks every element a repeat added. |
data-pms-available | "true" | "false" | Whether that room can be sold for the stay: it has a rate plan for it that can be paid for online. |
data-pms-ready | no value | Set once, when the script has bound the page for the first time. Never removed. |
Read these attributes in your CSS; never write them. A rooms template is not drawn by the browser, so data-pms-loading on it serves a sibling selector — template[data-pms-loading] + .rooms-waiting, say.
What a price means
- It is the total the booking page charges for that stay and party: every night, with the VAT and the city tax charged on top of the room rate already in it.
- It is in the property’s currency, the one the guest is charged in. A guest who picks another display currency in our account menu still sees the property’s currency in your own HTML.
- It is for a room that can be paid for. A room is
availableonly when it has a rate plan for the stay that can be paid for online — the rule of the booking window’s Book button. - An answer is kept for 60 seconds. Within a minute, elements that ask for the same stay, party and plan share one request. After it the next ask goes to the server again, so “Only 3 left” is true when it is shown.
- A value is asked again when what it asks for changes — a stay attribute, the search it follows, the page’s language. It is not refreshed on a timer while the page stays open.
- It is filled in the visitor’s browser. A search engine, and a visitor without scripts, read the text you wrote. Never compute a price in your own page or on your server: print the fields.
What is not available
What a site cannot get from the script today, and why.
- The lowest price in a month, or the next free date. A value is priced for one stay and one party.
calendar()gives a lowest price per night, but that is one night taken alone, not the price of a stay for a party, so “December from €82” built from it could be a price the booking page never charges. - A balance, or “the rest at the hotel”. There is
deposit, and no field for what remains. The rest is not always paid at the hotel, and when it is due is in the plan’s terms. Do not subtractdepositfrompriceyourself. - A price per person, in your own HTML. There is no such field. Children are priced by age, so the total divided by the heads is not a price anyone is charged. Do not divide
priceAmountyourself. Only the ready offer table has a per-person view,data-per="person". - A “was” price. The script knows no earlier price, so there is nothing to strike through.
- Repeats over days, nights or extras. A repeat is over rooms, and inside a room over its photographs, amenities and rate plans — one level deep. For a day-by-day view use
calendar(); for anything else draw fromrooms()in your own code — see JavaScript.