Page 1 of 1

Groups of rooms

Posted: Tue Jan 23, 2024 3:45 pm
by alexootes
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

Re: Groups of rooms

Posted: Wed Jan 24, 2024 12:43 pm
by lesleywoermeijer
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.

Re: Groups of rooms

Posted: Sat Feb 10, 2024 8:02 pm
by alexootes
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!

Re: Groups of rooms

Posted: Tue Feb 13, 2024 10:49 am
by annettemorgenroth
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.

Re: Groups of rooms

Posted: Thu Apr 11, 2024 7:05 am
by heavensrestbnb
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