• Resolved jokewouters

    (@jokewouters)


    Hi,

    By using ‘Morning checkout’ the price is calculated based on the nights but guest can still select the last day as their starting day. I don’t want this to be possible.

    For example, the room is booked from 6 to 8 november 2020, which is 2 nights for the calculation. Now when you use the reservation calendar again, I can select 8 november 2020 as a starting day. I don’t want that day to be available anymore if already reserved by another guest.

    How can I implement this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author DOTonPAPER

    (@dotonpaper)

    Hi,

    So just to understand you want the first client to be able to book from 6-8 of November and the next one to be able to book starting with the 9th of November. In this case, you want the night from 8th to 9th of November blocked automatically? This will not be possible.

    Best Regards,
    Support Team

    • This reply was modified 4 years, 4 months ago by DOTonPAPER.
    Thread Starter jokewouters

    (@jokewouters)

    Hi,

    Any tips for our developer on where in the cdoe we can tweak the plugin so this can be implemented for our website? We really need to calculate by night and keep the whole day booked.

    Kind regards,
    Joke Wouters

    Plugin Support Pinpoint World Support

    (@pinpointworld)

    Hi,

    To achieve this you have to modify the following files:
    booking-system/includes/reservations/class-backend-reservation.php comment the if() starting from line 165.
    booking-system/includes/calendars/class-backend-calendar-schedule.php and change day<"%s" to day<="%s" line 879.
    Keep in mind that these modifications will never be added to the plugin and will be removed once you update.

    Best Regards,
    Support Team

    Thread Starter jokewouters

    (@jokewouters)

    Hi,

    Thank you for your quick response.

    That worked great for the check out date but not for the check in date.
    The 9th of November is fully booked but the 6th of November is still half booked and can be selected by an new guest.

    More tips on where this particular code can be found?

    Kind regards,
    Joke Wouters

    Plugin Support Pinpoint World Support

    (@pinpointworld)

    Hi,

    Sorry for the delay. For the check-in you have to do the following changes:
    booking-system/includes/reservations/class-backend-reservation.php line 179
    replace: for ( $i = $check_in; $i <= $check_out; $i = $i + 86400 )
    with:

    $check_in_start = strtotime( $reservation['check_in'].' 12:00 - 1 day');
                            for ( $i = $check_in_start; $i <= $check_out; $i = $i + 86400 )

    and
    booking-system/includes/calendars/class-backend-calendar-schedule.php line 879
    replace the code in the if with this:

    `$check_in_start = strtotime( $reservation->check_in.’ 12:00 – 1 day’);
    $days = $wpdb->get_results($wpdb->prepare(‘SELECT * FROM ‘.$DOPBSP->tables->days.’ WHERE calendar_id=%d AND day>=”%s” AND day<=”%s”‘,
    $reservation->calendar_id,
    $check_in_start,
    $reservation->check_out));’

    Thread Starter jokewouters

    (@jokewouters)

    Hi,

    Unfortunately this doesn’t work. Now it books all days before the check in date.
    Could you check these changes? Thank you!

    Class-backend-reservation.php

    ORIGINAL CODE

    // Loop between timestamps, 24 hours at a time
                        for ( $i = $check_in; $i <= $check_out; $i = $i + 86400 ) {
                            $day = date( 'Y-m-d', $i );
                            $year = date( 'Y', $i );
                            $price_min  = 1000000000;
                            $price_max  = 0;

    NEW CODE

    // Loop between timestamps, 24 hours at a time
                        $check_in_start = strtotime( $reservation['check_in'].' 12:00 - 1 day');
                            for ( $i = $check_in_start; $i <= $check_out; $i = $i + 86400 ) {
                            $day = date( 'Y-m-d', $i );
                            $year = date( 'Y', $i );
                            $price_min  = 1000000000;
                            $price_max  = 0;

    Class-backend-calendar-schedule.php

    ORIGINAL CODE:

    if ($settings_calendar->days_morning_check_out == 'true'){
                        $days = $wpdb->get_results($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->days.' WHERE calendar_id=%d AND day>="%s" AND day<"%s"',
                                                                  $reservation->calendar_id,
                                                                  $reservation->check_in,
                                                                  $reservation->check_out));

    NEW CODE:

    if ($settings_calendar->days_morning_check_out == 'true'){
                        $check_in_start = strtotime( $reservation->check_in.' 12:00 – 1 day');                    
                        $days = $wpdb->get_results($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->days.' WHERE calendar_id=%d AND day>="%s" AND day<="%s"',
                                                                  $reservation->calendar_id,
                                                                  $check_in_start,
                                                                  $reservation->check_out));
    Plugin Support Pinpoint World Support

    (@pinpointworld)

    Hi,

    Is it possible to contact us via the form here: https://pinpoint.world/contact and send us a link and FTP account to check the files?

    Best Regards,
    Support Team

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Price by night but keep last day booked’ is closed to new replies.