Availability Calendar – Show fully booked dates on general calendar

Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Availability Calendar – Show fully booked dates on general calendar

Viewing 15 posts - 31 through 45 (of 94 total)
  • Author
    Posts
  • #1358567
    Rafael Cavalcante
    Participant

    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.

    #1366766
    Mickael Quirin
    Participant

    For 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.

    #1368159
    Mickael Quirin
    Participant

    I 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.

    #1368168
    Pavel Lukáš
    Participant

    Mickael, 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.

    #1368303
    Sylvain Deschamps
    Participant

    I 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.

    #1368372
    Mickael Quirin
    Participant

    I’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.

    #1369146
    Mickael Quirin
    Participant

    @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.

    #1370247
    Sylvain Deschamps
    Participant

    Just 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.

    #1370265
    Mickael Quirin
    Participant

    @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.

    #1372874
    Mickael Quirin
    Participant

    Hello.
    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).

    #1372904
    Sylvain Deschamps
    Participant

    On 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

    #1372907
    Sylvain Deschamps
    Participant

    An example is 26@28 dec 2022 if you want to try

    #1372916
    Mickael Quirin
    Participant

    I can’t look further because I’m on my phone right now but chalet 5 doesn’t seem booked on this date ?

    #1372920
    Sylvain Deschamps
    Participant

    I 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

    #1373096
    Mickael Quirin
    Participant

    Hello 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 ?

    View post on imgur.com

Viewing 15 posts - 31 through 45 (of 94 total)
  • You must be logged in to reply to this topic.