Offer prices
The live prices of one stay as a table, for an offer or a room page. Each row opens the booking with that choice.
- Box
data-pms-booking="offer"- Goes on
- An offer or a room page
- Drawn
- On your page, in a shadow root
- Own HTML instead
- Yes — recommended
The ready component
One line to paste. It wears the property’s branding from the PMS until your site’s stylesheet says otherwise.
- Place the script once, on every page that shows a component — see Install the script.
- Paste the component where it should appear.
<div data-pms-booking="offer" data-check-in="2026-12-24" data-check-out="2026-12-27"></div>Live preview on a sample hotel — invented rooms and prices, placeholder pictures. Open in a new tab
The live preview runs only when these docs are opened on a developer's own machine.
<div data-pms-booking="offer" data-check-in="2026-12-24" data-check-out="2026-12-27"></div>Settings
What the component shows and where it leads — attributes on its box.
| Attribute | Values | What it does |
|---|---|---|
data-check-in, data-check-out | YYYY-MM-DD | The stay the table prices; check-out is the day of departure. |
data-stay | "tomorrow" | "weekend" | Or a stay counted from the visitor's today. With neither, the table says it has no dates yet. |
data-plan | rate plan id | Prices of this rate plan only — a package; rooms the plan does not sell are left out. Left out: each room's lowest price. |
data-rows | "guests" | guests: a row per party size of one room, instead of a row per room type. Needs data-room. |
data-room | room type id | The room a party-size table is about. |
data-guests | "2,3,4" — up to eight sizes of 1–20 | The party sizes of that table. Left out: 2, 3 and 4. |
data-adults | 1–20 — default 2 | The party a room-type table is priced for. |
data-child-ages | ages 0–17, comma-separated | The children every row's party brings, one age per child: each price is asked with them, a per-person price counts them, and each row's link 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-per | "person" | person: the price divided by the party, instead of the total for the stay. |
data-title | text, up to 80 characters | A heading above the table. |
Without a stay the table says it has no dates yet. A row the property cannot sell for the stay says so instead of showing a price.
How it looks — colours, corners, fonts — is not an attribute. Your site’s stylesheet sets it with CSS variables: see Styling.
With your own HTML
Recommended. Your own room cards, price lines and tables, filled with live prices from the same availability the booking window reads — what your page prints is what the next page charges. The guide by task — one price, a price that follows the search form, a line that shows only when rooms are free — is Prices and availability.
A repeat: one card per room type
A template is repeated once per room type, right after itself, with live values for the stay. Inside it, a second template repeats over that room’s photographs, amenities or rate plans. The browser never draws a template, so the braces are never seen raw. With no stay named, the prices are for one night from tomorrow. A room that cannot be sold says why: reason is the sentence the booking window shows, reasonKind the same as one word.
Live preview on a sample hotel — invented rooms and prices, placeholder pictures. Open in a new tab
The live preview runs only when these docs are opened on a developer's own machine.
<div class="rooms"> <template data-pms-each="rooms" data-stay="weekend"> <article class="room"> <div class="room-strip"> <template data-pms-each="photos" data-limit="3"> <img src="{{src}}" alt="{{roomName}}, photograph {{index}}" loading="lazy"> </template> </div> <span class="room-badge" data-pms-if="scarce">Only {{left}} left</span> <h3>{{name}}</h3> <p> Sleeps {{maxGuests}}<span data-pms-if="area"> · {{area}} m²</span> · <span data-pms-text="checkIn" data-format="short">arrival</span> – <span data-pms-text="checkOut" data-format="short">departure</span>, {{nights}} </p> <ul class="room-amenities"> <template data-pms-each="amenities" data-limit="4"><li>{{label}}</li></template> </ul> <p data-pms-if="available"> from <strong>{{pricePerNight}}</strong> a night · {{price}} for the stay </p> <p class="room-off {{reasonKind}}" data-pms-if="!available"> {{reason}}<span data-pms-if="reasonKind=min-stay"> — add nights to make it {{minStay}}</span> </p> <ul class="room-plans"> <template data-pms-each="plans"> <li> <span>{{name}}</span> <strong>{{price}}</strong> <small data-pms-if="includes">Includes {{includes}}</small> <small data-pms-if="cancellation">{{cancellation}}</small> <small data-pms-if="deposit">{{deposit}} due at booking</small> <small data-pms-if="taxes">The price includes: {{taxes}}</small> <a href="{{bookUrl}}">Book {{roomName}}</a> </li> </template> </ul> </article> </template></div>.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px;}.room { border: 1px solid #d8cdb6; background: #fffdf8;}/* a room that cannot be sold for this stay */.room[data-pms-available="false"] { opacity: 0.6;}.room-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory;}.room-strip img { flex: 0 0 100%; height: 190px; object-fit: cover; scroll-snap-align: start;}.room-plans li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;}.room-plans small { grid-column: 1 / -1;}| 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-text | a room field | Filled with that room's field; no data-room needed. A date honours data-format. An unknown field leaves your text. |
data-format | "long" | "short" | "numeric" | "weekday" | "iso" | How a checkIn or checkOut value is written, in the page's language: long — 8 December; short — 8 Dec; weekday — Tuesday 8 December; numeric — the language's own digits form (08/12/2026 in English, 08.12.2026 г. in Bulgarian); iso — 2026-12-08. Left out: YYYY-MM-DD. |
data-pms-each="photos" | Repeats over the room's photographs. The inner template is replaced by its rows. | |
data-pms-each="amenities" | Repeats over the room's amenities. | |
data-pms-each="plans" | Repeats over the room's rate plans — only the named one when the rooms template has data-plan. | |
data-limit | a whole number above 0 | At most this many rows of that list. |
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. |
What {{…}} and data-pms-text may print in a rooms template — and data-pms-text 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. |
Inside data-pms-each="photos":
| Field | What it prints |
|---|---|
src | The address of the photograph. |
index | The row's number in the list, from 1. |
Inside data-pms-each="amenities":
| Field | What it prints |
|---|---|
label | The amenity's name, in the page's language. |
index | The row's number in the list, from 1. |
Inside data-pms-each="plans" — in the order the hotel lists its plans:
| 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. |
Lists go one level deep, and only inside a rooms template. Inside a list the room’s own fields stay readable; where a name is in both — id, name, description, price, pricePerNight, bookUrl in a list of plans — the list’s wins, and roomName and roomId always mean the room. An image or a link whose value is empty loses its src or href rather than pointing nowhere. When the cards are in, pms-booking-rendered fires on the template; they are drawn again when the language or a stay attribute of the template changes — the cards of the stay before are removed at once, and the template carries data-pms-loading until the new ones are in. If the prices cannot be read, nothing is drawn: put your own fallback beside the template.
A price with no room named
The cheapest room that can be sold for the stay — with data-plan, the cheapest on that rate plan. Your own text stays when nothing can be sold.
Live preview on a sample hotel — invented rooms and prices, placeholder pictures. Open in a new tab
The live preview runs only when these docs are opened on a developer's own machine.
<p class="rate"> Rooms this weekend <span data-pms-text="fromPricePerNight" data-stay="weekend">from €95</span> a night · <span data-pms-text="fromPrice" data-stay="weekend">ask us</span> for the stay</p>| 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-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. |
data-plan | rate plan id | The price of this rate plan only. Left out: the room's lowest price. |
What data-pms-text prints with no room named:
| 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. |
The stay is the one written on the element itself — data-stay, or data-check-in with data-check-out; with neither, one night from tomorrow.
Prices that follow your search form
With data-stay="search" a value, a rooms repeat and a link take their dates and their party from the search form on the page: the form they are inside, else the page’s first form with a data-pms-dates or data-pms-guests button, else its first ready search form. They are priced once the search is complete — both dates, an age for every child — about half a second after the guest stops changing it.
<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. |
Until the search is complete your own text stands, no card is drawn and the link carries no dates — unless the element also has data-check-in and data-check-out: then those dates are priced meanwhile. When the search changes, the price before is removed at once and the element carries data-pms-loading until the new one is in. What a card’s bookUrl and the link carry is what the price was asked for.
One live value of one room
A single value of one room inside your own text. What you write inside stays until the answer arrives, and comes back whenever there is nothing to print for the stay the element asks for now: left reads your own words again when the room cannot be sold.
<p class="rate"> The Garden Suite for the weekend: <span data-pms-text="price" data-room="00000000-0000-0000-0000-000000000000" data-stay="weekend">from €240</span>, <span data-pms-text="left" data-room="00000000-0000-0000-0000-000000000000" data-stay="weekend">a few</span> left, arriving <span data-pms-text="checkIn" data-format="long" data-room="00000000-0000-0000-0000-000000000000" data-stay="weekend">Friday</span>.</p>| 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-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. |
data-plan | rate plan id | The price of this rate plan only. Left out: the room's lowest price. |
data-format | "long" | "short" | "numeric" | "weekday" | "iso" | How a checkIn or checkOut value is written, in the page's language: long — 8 December; short — 8 Dec; weekday — Tuesday 8 December; numeric — the language's own digits form (08/12/2026 in English, 08.12.2026 г. in Bulgarian); iso — 2026-12-08. Left out: YYYY-MM-DD. |
A line that shows only when it is true
data-pms-if on any element of yours shows or hides it by the live answer for the stay written on it. Write hidden on it: it appears only on a definite yes. A value or a link inside it is filled for the same room, stay and party.
<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. |
While the answer is on its way, and when the request fails, the element stays as you wrote it: “We are full” is never shown because of an error. With data-stay="search" the line follows your search form.
If a rule of your own stylesheet sets display on the element, it wins over hidden and the line always shows — see Show something only when rooms are free for the one line of CSS that fixes it.
From JavaScript
A site built with React, Vue or another framework can draw from the same data in its own components.
function whenBookingReady(run) { if (window.pmsBooking) run(window.pmsBooking); else window.addEventListener('pms-booking-ready', () => run(window.pmsBooking), { once: true, });}
whenBookingReady(async (booking) => { const rooms = await booking.rooms({ stay: 'weekend', adults: 2 }); // [{ id, name, description, photo, photos, amenities, area, maxGuests, // available, left, scarce, reasonKind, reason, minStay, …, price, pricePerNight, // priceAmount, currency, nights, checkIn, checkOut, bookUrl, plans: [{ … }] }] drawRooms(rooms.filter((room) => room.available));});An answer is kept per stay, party, plan and language for one minute; a later call asks again, and so does the next call after the language changes. rooms() takes a named stay or two dates, not search: to follow a search form, read it with getSearch() and pass its dates and party on.
A template works in a framework too. A <template data-pms-each="rooms"> that a framework rendered is read like one written in HTML — a framework puts a template’s children on the element itself, and the script reads them there — and one added after the page loaded is noticed by itself. Two things to know:
- The braces must reach the page as text. In JSX
{{name}}is an object, not text: write{'{{name}}'}. - The cards are added right after the template, as its siblings — elements your framework did not create. Our tests cover a template made the way a framework makes one; they do not cover a framework drawing that part of the page again afterwards. Keep the template somewhere the framework leaves alone once drawn, or use
rooms()and let your components own the cards.
Room type and rate plan ids
data-room, data-rooms and data-plan take the property’s own ids. An id does not change when a name does. The hotel finds them in Tape Chart Link, under Booking engine → Components, on this component’s page; the snippets here show 00000000-0000-0000-0000-000000000000 in their place.
Every attribute, method and variable: Attributes · JavaScript · Styling.