Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Availability Calendar – Show fully booked dates on general calendar
- This topic has 98 replies, 21 voices, and was last updated 1 week, 1 day ago by Ert Pehka.
- AuthorPosts
- September 26, 2022 at 10:21 am #1358567Rafael CavalcanteParticipant
I upvote for this feature.
Each time a person navigate on my website searching for a date, gets frustated with the message “no accomodances for this date” It Will be great If only shows not fully booked dates on the main search form.October 18, 2022 at 6:21 am #1366766Mickael QuirinParticipantFor those who are interrested, I currently try to modify this, I almost succeded for the check-in calendar but did’nt (for now) for the check-out calendar.
I’ll keep you in touch if you want.
October 21, 2022 at 6:10 am #1368159Mickael QuirinParticipantI did it. check in and check out are working. I tested with two accomodations with one of them with two rooms.
check-in calendar grey-out date who are full everywhere.
check-out calendar allow selection of date only until no room are available for this range. (not very clear sorry).
I still need time to make things prettier but its all good as far as I tested.October 21, 2022 at 6:32 am #1368168Pavel LukášParticipantMickael, my fingers are crossed that it works out. I hope the authors will also finish it in the plugin.
It’s a needed feature.
I also vote for it.October 21, 2022 at 1:17 pm #1368303Sylvain DeschampsParticipantI don’t know if it’s a “one man development” but I asked to add the year in the Reservations -> All bookings since we are often booked a year/year and a half ahead and it’s not been done. I guess it’s probably one line of code (not hundreds of lines for sure) so i’m not holding my breath for the calendar unfortunately.
October 21, 2022 at 10:33 pm #1368372Mickael QuirinParticipantI’ll look into that, I already modified this list to add the service list of reservation because it’s cumbersome to have to look into each of them.
October 25, 2022 at 1:08 am #1369146Mickael QuirinParticipant@Sylvain
If you’re willing to edit code yourself here the modificitation for your need:
two possibilities
1/always show year (simplier but less aesthetic)
in file wp-content\plugins\motopress-hotel-booking\includes\admin\manage-cpt-pages\booking-manage-cpt-page.php
change line 156
echo (!is_null( $checkInDate )) ? ‘<time title=”‘ . esc_attr( \MPHB\Utils\DateUtils::formatDateWPFront( $checkInDate ) ) . ‘”>’ . date_i18n( ‘M j’, $checkInDate->format( ‘U’ ) ) . ‘</time>’ : ‘<span aria-hidden=”true”>’ . static::EMPTY_VALUE_PLACEHOLDER . ‘</span>’;
by
echo (!is_null( $checkInDate )) ? ‘<time title=”‘ . esc_attr( \MPHB\Utils\DateUtils::formatDateWPFront( $checkInDate ) ) . ‘”>’ . date_i18n( ‘Y M j’, $checkInDate->format( ‘U’ ) ) . ‘</time>’ : ‘<span aria-hidden=”true”>’ . static::EMPTY_VALUE_PLACEHOLDER . ‘</span>’;and
line 157
echo (!is_null( $checkOutDate )) ? ‘<time title=”‘ . esc_attr( \MPHB\Utils\DateUtils::formatDateWPFront( $checkOutDate ) ) . ‘”>’ . date_i18n( ‘M j’, $checkOutDate->format( ‘U’ ) ) . ‘</time>’ : ‘<span aria-hidden=”true”>’ . static::EMPTY_VALUE_PLACEHOLDER . ‘</span>’;
by
echo (!is_null( $checkOutDate )) ? ‘<time title=”‘ . esc_attr( \MPHB\Utils\DateUtils::formatDateWPFront( $checkOutDate ) ) . ‘”>’ . date_i18n( ‘Y M j’, $checkOutDate->format( ‘U’ ) ) . ‘</time>’ : ‘<span aria-hidden=”true”>’ . static::EMPTY_VALUE_PLACEHOLDER . ‘</span>’;2/show year only if year is not actual year.
Line 156
Add
$format_checkInDate = (date(‘Y’) == date(‘Y’,$checkInDate->format( ‘U’ ))? ‘M j’:’Y M j’ );
$format_checkOutDate = (date(‘Y’) == date(‘Y’,$checkOutDate->format( ‘U’ ))? ‘M j’:’Y M j’ );
before then replace
echo (!is_null( $checkInDate )) ? ‘<time title=”‘ . esc_attr( \MPHB\Utils\DateUtils::formatDateWPFront( $checkInDate ) ) . ‘”>’ . date_i18n( ‘M j’, $checkInDate->format( ‘U’ ) ) . ‘</time>’ : ‘<span aria-hidden=”true”>’ . static::EMPTY_VALUE_PLACEHOLDER . ‘</span>’;
by echo (!is_null( $checkInDate )) ? ‘<time title=”‘ . esc_attr( \MPHB\Utils\DateUtils::formatDateWPFront( $checkInDate ) ) . ‘”>’ . date_i18n( $format_checkInDate, $checkInDate->format( ‘U’ ) ) . ‘</time>’ : ‘<span aria-hidden=”true”>’ . static::EMPTY_VALUE_PLACEHOLDER . ‘</span>’;
and line 158
replace
echo (!is_null( $checkOutDate )) ? ‘<time title=”‘ . esc_attr( \MPHB\Utils\DateUtils::formatDateWPFront( $checkOutDate ) ) . ‘”>’ . date_i18n( ‘M j’, $checkOutDate->format( ‘U’ ) ) . ‘</time>’ : ‘<span aria-hidden=”true”>’ . static::EMPTY_VALUE_PLACEHOLDER . ‘</span>’;
by
echo (!is_null( $checkOutDate )) ? ‘<time title=”‘ . esc_attr( \MPHB\Utils\DateUtils::formatDateWPFront( $checkOutDate ) ) . ‘”>’ . date_i18n( $format_checkOutDate, $checkOutDate->format( ‘U’ ) ) . ‘</time>’ : ‘<span aria-hidden=”true”>’ . static::EMPTY_VALUE_PLACEHOLDER . ‘</span>’;I assume that if you make modification you understand the “risk” of breaking things and the fact that neither I or motopress team can be held responsible. Always make backup and avoid playing with production website. If you’ne not feeling confortable with this, don’t touch it.
October 27, 2022 at 7:13 am #1370247Sylvain DeschampsParticipantJust to let you know that it worked… Thank you… What REALLY disappoints me is that it’s a feature that I was told was in the “request list” but when I see it’s two lines of code and it’s not been modified for months, I just don’t get it.
October 27, 2022 at 8:20 am #1370265Mickael QuirinParticipant@Sylvain, I’m happy that I could be useful to someone.
Don’t be too harsh to the dev, even when something seem easy to do, it can be at the bottom of the list or hide some changes under it more complicated.
And like you said, I don’t know either if it’s a one man dev or not.
If you need anything, I’ll be happy to look if it’s in my level of competence.I currently increment a file with all the modification I add, (mainly to redo it after update of them plugin). I could post it online if that’s something you guys are interested in.
And who knows maybe my changes will be push on official code.November 4, 2022 at 3:06 am #1372874Mickael QuirinParticipantHello.
Here we go, sorry for the delay, the flu got me :P.Anyway, I precise that this modification came as-is, meaning, its working for me but I’m not sure it’ll work for you.
I tested with multiple accomodation with multiple room.Don’t hesitate to tell me if you tested it and if its working great for you or if you encounter bugs (that I may be able to solve).
The file to modify is :
wp-content/plugins/motopress-hotel-booking/assets/js/public/mphb.js
and his minified version (its the minified version that is used by the website).
The files are version 4.4.4 (make sure you’re up-to-date)Here is the link to show you the difference : https://www.diffchecker.com/MHQoJW1e
there are four modifications. Thoses modification will do two things on the main search widget:
-In check-in pop-up, it’ll grey-out date that are fully booked.
-In check-out pop-up, it’ll grey-out dates where its no longer possible to book (booked or rules).If you want information of what they do, ask me.
Here is the link of the mphb.js and mphb.js.min (both modified), you can use them to replace existing ones (don’t forget to backup your original files)
https://drive.google.com/drive/folders/1Jp7JxwqdToYSD7iSoKux0qXKK52C66ej?usp=sharing
I precise again, that is not the work of motopress team, neither they or I can be held responsible if something went wrong (always keep backup files and avoid playing with production website).November 4, 2022 at 4:21 am #1372904Sylvain DeschampsParticipantOn our side, I had the files checked to make sure it was ok and it doesn’t work on our side. I replaced the two files, I also checked the version. Look at domainewhiterocks.com if you want, main screen, the availability calendar. Thank’s a lot, great work though
November 4, 2022 at 4:26 am #1372907Sylvain DeschampsParticipantAn example is 26@28 dec 2022 if you want to try
November 4, 2022 at 4:52 am #1372916Mickael QuirinParticipantI can’t look further because I’m on my phone right now but chalet 5 doesn’t seem booked on this date ?
November 4, 2022 at 5:10 am #1372920Sylvain DeschampsParticipantI have booked all chalet between april 19th to april 21st 2023. So take a look whenever you want if you can see what the problem can be! THANK’s a lot, no rush
November 5, 2022 at 12:06 am #1373096Mickael QuirinParticipantHello Sylvain.
I just looked at 19-21 April 2023 and it works for me.Maybe the old js file is in your cache in your browser.
Can you try ctrl+f5 to force refresh the page and the assets ? - AuthorPosts
- You must be logged in to reply to this topic.