Groups of rooms

Suggestions and ideas to make Beds24.com better
Post Reply
alexootes
Posts: 3
Joined: Tue Apr 25, 2017 7:19 pm

Would it be possible to implemented a similar grouping feature for rooms as is currently is implemented for properties? We have the following problem, on one property we have 10 people apartments and 6 people apartments and would like to generate separate booking pages for them. Currently we can only display one apartment or all apartments on the booking page
lesleywoermeijer
Posts: 298
Joined: Wed Dec 28, 2016 2:20 pm

If you are using the booking url you can specify the Room id to be displayed.

https://wiki.beds24.com/index.php/Categ ... Parameters

add &roomid= then the room number to show that specific room/room type.
alexootes
Posts: 3
Joined: Tue Apr 25, 2017 7:19 pm

Sorry, should have been a bit more specific. Looking for a way to display a wordpress booking widget with several rooms pre-selected. The following code only displays the first room, but not the second:
[beds24-embed custom="&hideheader=yes" lang="en" scrolltop="no" width=100% height="500" "propid=132516" roomid="422818,422831" ]

Is there a better/correct way of doing this?

Thanks!
annettemorgenroth
Posts: 1339
Joined: Sun Jun 30, 2013 8:44 am

There is no provision to do this via the plugin. Just use the code snippet instead of the short code. You can add it when you set your Wordpress editor to show you the source code.
heavensrestbnb
Posts: 4
Joined: Sat Sep 18, 2021 5:03 am
Location: New Zealand
Contact:

Kia ora,

I encountered a similar limitation and found a workaround that might help you too. By using a simple JavaScript code snippet, you can dynamically modify the booking form to include a hidden input that specifies additional room IDs or any other parameters you'd like to add. This way, when the form is submitted, it carries over these parameters and can influence which rooms are displayed on the booking page.

Here’s a brief overview of the solution:

<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
function addHiddenInput() {
var bookingForm = document.querySelector('.book-form-inline');
if (bookingForm && !bookingForm.querySelector('input[name="hideroom"]')) {
var hiddenInput = document.createElement('input');
hiddenInput.type = 'hidden';
hiddenInput.name = 'hideroom'; // The parameter name might need adjustment based on what the Beds24 API expects
hiddenInput.value = 'YOUR_ROOM_IDS'; // e.g., '422818,422831'
bookingForm.appendChild(hiddenInput);
console.log('Additional room IDs included.');
}
}

// Setup to handle dynamic content
const observer = new MutationObserver(addHiddenInput);
observer.observe(document.body, { childList: true, subtree: true });

// Attempt to modify the form immediately as well
addHiddenInput();
});
</script>


Please replace `'YOUR_ROOM_IDS'` with the IDs of the rooms you want to include. This script should be placed on your webpage where the booking form is loaded. It works by checking for the form and then automatically inserting a hidden input with the specified room IDs, ensuring that the additional rooms are considered during the booking process.


I hope this helps!

Best regards,

Robert
Post Reply