Multiple enterprises and pre-selected locations
This guide will show you how to open the booking engine with multiple enterprises and set a pre-selected city or location.
Important: Make sure you fulfill all the required Prerequisites. Without doing so, the code of the use cases can be hard to understand or the behavior of the code can differ from what you expect.
Sample code
Below is some sample HTML and Javascript code to demonstrate the functionality. Numbered notes beneath the code snippet relate to the numbered comments within the code.
The sample uses an example scenario of three hotels, with two of them in the same city location:
One hotel in Paris
One hotel in London
Another hotel in London
1. Install booking engine loader script
For more details, see Install booking engine loader script.
2. Add buttons for opening the booking engine with specific city pre-selected
Buttons are disabled on page load, so users can't click the buttons until the Booking Engine Widget is ready to be used. We enable it later when it's ready.
3. Initialize Booking Engine Widget
For more details, see Initialize Booking Engine Widget. If you are not sure where to find the Configuration ID, see the FAQ.
Even though it's called 'location' in the User Interface, the API needs a City ID. If you are not sure where to find the City ID, see the FAQ for details. If you have several hotels from the same location, the then the City ID is the same in all of them.
4. This guide is written for the Production environment
If you want to test this code in a different environment, please refer to our guide for Testing in the Demo environment.
Conclusion
In this guide, you've learned how to use a multi-enterprise booking engine and how to set a pre-selected city/location. The Booking Engine Widget Javascript API supports more than just setting dates - see the full Javascript API Reference to find other options you could use.
Last updated