Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking [mphb_checkout] number of guests for services
- This topic has 16 replies, 4 voices, and was last updated 1 year, 11 months ago by Felizia Katzer.
- AuthorPosts
- October 11, 2021 at 5:49 am #1198177Felizia KatzerParticipant
Hello,
I have services that can choosen for the number of guests.
When the guest ueses the checkout form, per default, the number of guests for this services are the maximum of guests that are allowed for the accomodation.
Independent which number of guests he selected at the checkout.
So for example he choose 2 guests and checkt a towel package for 4 persons. And forget to change the number.Is there a way to initialise the number of guests in dependence to the number of guests that where choosen in the form?
Thank you
FeliziaOctober 14, 2021 at 1:44 am #1199648Andre FloresModeratorHello Felizia,
This is how the Hotel Booking plugin functions by default at the moment. We do have a feature request change the default number of guests the service is applied to and I have added your up-vote to it as well. In case there are more similar requests, we will consider implementing this option in one of the plugin future updates.
Regards,
AndreOctober 14, 2021 at 6:59 am #1199899Felizia KatzerParticipantgreat thank you
October 15, 2021 at 2:34 am #1200221Andre FloresModeratorYou are welcome!
November 2, 2021 at 1:18 am #1208087Domaine LangeletParticipantWe would also benefit from this improvement.
November 2, 2021 at 5:18 am #1208172Felizia KatzerParticipantperfect Theo. Hope the development will take place soon.
December 8, 2022 at 6:32 am #1387984Felizia KatzerParticipantSomeone else who hast the problem with the services and the number of guests that displayed per default?
December 8, 2022 at 9:27 am #1388057Mickael QuirinParticipantfor what its worth, if thats what you need,
you can test this:
(function ($) { $(document).ready(function() { $('.mphb_checkout-guests-chooser').change(function(){ let booking_number = $(this).attr('id').split('-')[1]; let selector = '[id^=mphb_room_details-' + booking_number + '-service]'; $(selector).val($(this).find("option:selected").attr('value')).trigger("change"); }); }); })(jQuery);
to add it, you can install wpcode plugin ,
add a new snippet,
choose custom snippet and paste the code inside,
choose javascript snippet on the right.
leave auto-insert and site-wide header .
click on activate and save on the top rightit should work for multiple reservation (its not activated here so I can’t test it).
December 8, 2022 at 10:31 pm #1388291Felizia KatzerParticipantHello Mickael,
thank you for your solution.I entered it in the functions.php and receive this error message:
syntax error, unexpected ‘$’, expecting variable (T_VARIABLE)Did I something wrong?
Thank you
FeliziaDecember 8, 2022 at 10:50 pm #1388293Felizia KatzerParticipantNow I tried it with the plugin and installed it and entered the code.
Now it works, great solution, this helps me very much, thank you
Greetings FeliziaDecember 9, 2022 at 1:17 am #1388314Mickael QuirinParticipantIf you want to add it to your function.php file, you need to remove the first and last line and put it before the })(jQuery); line, but you have the risk that your modification will be erased with an update.
Glad it help you out
December 26, 2022 at 8:39 am #1394329Felizia KatzerParticipantHello Mickael,
when I user your code snippet, the calculation of services did not work any more. e.g. service for a dog is not displayed in the prices when it was selectes as a service. Do you have an idea?
Thank you
FeliziaDecember 26, 2022 at 8:54 am #1394344Mickael QuirinParticipantWhat do you mean by not displayed in the price ?
The price breakdown does not update when the number change ?December 26, 2022 at 11:52 pm #1394427Felizia KatzerParticipantin the price breakdown the services were not displayed when they are selected. How can I send you a picture for this scenario?
December 27, 2022 at 12:13 am #1394436Mickael QuirinParticipantDon’t worry, it’s the same for me, I’ll look into it and come back here when I find out why with a code update.
Sorry for that
- AuthorPosts
- You must be logged in to reply to this topic.