• Resolved heywatchoutdude

    (@heywatchoutdude)


    Hi,

    I have enabled the option “Allow late booking” with “Yes”.

    Note: Late booking permission time (mins) is empty.
    So theoretically it should “Leaving empty means booking is accepted until the last minute before appointment finishes.”

    1 Service / Working hours:
    Wednesday 10:00 AM – 07:00 PM
    Saturday 10:00 AM – 07:00 PM

    Issue: On Wednesday or Saturday at 10:01 AM it is not possible to schedule an appointment, although some slots are still free.

    Any idea whats the cause of the issue?

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Hakan Ozevin

    (@puckrobin)

    Hi,

    Late booking works only for services whose durations are equal to the time base. This explanation is missed in the description.

    So it is not suitable for a service lasting for 9 hours.

    As an alternative idea, if client arrival time is flexible and you have one slot for the day, you can use service duration as “All day”. Then client will book for the day, not needing to select a time.

    Cheers,
    Hakan

    Thread Starter heywatchoutdude

    (@heywatchoutdude)

    Hi,

    The time isn’t necessary because it will get removed anyway in the confirmation mail, custom function:

    /** DATE_ONLY **/
    add_filter( 'app_email_replace_pre', 'app_pholder_date_only', 10, 2 );
    function app_pholder_date_only( $text, $r ) {
    if ( empty( $r->ID ) ) {
    return $text;
    }
    $booking = wpb_get_booking( $r->ID );
    return str_replace( 'DATE_ONLY', $bo

    Note: I have 20 slots per day, which are also gets displayed at the calendar, custom function:

    /**
    * Fill calendar cell with available worker count
    * Return array
    */
    add_filter( 'app_weekly_calendar_cell_fill', 'app_calendar_cell_fill', 10, 2 );
    add_filter( 'app_monthly_calendar_cell_fill', 'app_calendar_cell_fill', 10, 2 );
    function app_calendar_cell_fill( $arr, $slot ) {
        if ( $slot->reason || is_admin() && !(defined( 'WPB_AJAX' ) && WPB_AJAX ) ) {
            return $arr;
    	}
    
       if ( $slot->calendar->is_admin() ) {
         return $arr;
       }
    
        $start	= $slot->get_start();
        $end	= $slot->get_end();
        $busy	= isset( $slot->stat[$start][$end]['count'] ) ? $slot->stat[$start][$end]['count'] : 0;
    
        if ( $slot->get_worker() ) {
            $avail = 1;
        } else {
        	$avail = isset( $slot->stat[$start][$end]['available'] ) ? $slot->stat[$start][$end]['available'] : $slot->available_workforce(  );
    	}
    
    	$result	= max( 0, $avail - $busy );
        $fill	= !empty($arr['fill']) ? $arr['fill'].'<span style="font-size: 14px;">'.$result.'/20</span>' : $result;
    
        return array( 'class_name' => 'app-cell-centered', 'fill' => $fill );
    
    }
    
    /**
    * Example of custom time table display for monthly calendar for a 12-hours service
    * You can wrap the output with span tag for easier styling, e.g. return '<span>Morning Session</span>'
    */
    add_filter( 'app_timetable_cell_fill', 'app_custom_time_display', 10, 2 );
    function app_custom_time_display( $display, $slot ) {
        $service = $slot->get_service();
        if ( $service != 1 || BASE()->is_package( $service )  ) # Replace with your service ID
            return $display;
    
        if ( date( 'G', $slot->get_start() ) < 12 ) {
            return '<span style="font-size: 14px;">Freie Pl?tze:</span>';
        } else {
            return '<span style="font-size: 14px;">Freie Pl?tze:</span>';
    	}
      
    }
    Plugin Author Hakan Ozevin

    (@puckrobin)

    What is your question?

    Thread Starter heywatchoutdude

    (@heywatchoutdude)

    Hi,

    I want to make the function “late booking” available for all 20 slots per day.

    Do I need to change the working hours from 9 hours to all day, in order to get it working?

    Plugin Author Hakan Ozevin

    (@puckrobin)

    Yes.

    Do not forget to set working hours of the service to cover all day. You can click on the column header to set all day.

    Thread Starter heywatchoutdude

    (@heywatchoutdude)

    There is no other workaround available?
    Because I don’t want to make the service the whole day available.
    (We have opening time from 10:00 AM – 07:00 PM)

    Plugin Author Hakan Ozevin

    (@puckrobin)

    For an all day service client will only see the date in emails, not time. So you can add a fixed line of text in emails that your office opens at 10am and closes at 7pm.

    It is like saying check-in time is 2pm and checkout time is 11am for a hotel business.

    Thread Starter heywatchoutdude

    (@heywatchoutdude)

    Yeah but the slots are still available after 7:00 PM on the same day which makes no sense.

    Plugin Author Hakan Ozevin

    (@puckrobin)

    When you set service duration as “All day”, time slots are not available. Client can only select date.

    For example, select “Full Day City Tour” on our demo website:
    https://demo.wp-base.com/

    Thread Starter heywatchoutdude

    (@heywatchoutdude)

    Yes that may works but now it wont display the slots (so the customer doesnt know how many slots are left) because im using the following function:

    /**
    * Fill calendar cell with available worker count
    * Return array
    */
    add_filter( 'app_weekly_calendar_cell_fill', 'app_calendar_cell_fill', 10, 2 );
    add_filter( 'app_monthly_calendar_cell_fill', 'app_calendar_cell_fill', 10, 2 );
    function app_calendar_cell_fill( $arr, $slot ) {
        if ( $slot->reason || is_admin() && !(defined( 'WPB_AJAX' ) && WPB_AJAX ) ) {
            return $arr;
    	}
    
       if ( $slot->calendar->is_admin() ) {
         return $arr;
       }
    
        $start	= $slot->get_start();
        $end	= $slot->get_end();
        $busy	= isset( $slot->stat[$start][$end]['count'] ) ? $slot->stat[$start][$end]['count'] : 0;
    
        if ( $slot->get_worker() ) {
            $avail = 1;
        } else {
        	$avail = isset( $slot->stat[$start][$end]['available'] ) ? $slot->stat[$start][$end]['available'] : $slot->available_workforce(  );
    	}
    
    	$result	= max( 0, $avail - $busy );
        $fill	= !empty($arr['fill']) ? $arr['fill'].'<span style="font-size: 14px;">'.$result.'/20</span>' : $result;
    
        return array( 'class_name' => 'app-cell-centered', 'fill' => $fill );
    
    }
    
    /**
    * Example of custom time table display for monthly calendar for a 12-hours service
    * You can wrap the output with span tag for easier styling, e.g. return '<span>Morning Session</span>'
    */
    add_filter( 'app_timetable_cell_fill', 'app_custom_time_display', 10, 2 );
    function app_custom_time_display( $display, $slot ) {
        $service = $slot->get_service();
        if ( $service != 1 || BASE()->is_package( $service )  ) # Replace with your service ID
            return $display;
    
        if ( date( 'G', $slot->get_start() ) < 12 ) {
            return '<span style="font-size: 14px;">Freie Pl?tze:</span>';
        } else {
            return '<span style="font-size: 14px;">Freie Pl?tze:</span>';
    	}
      
    }
    Plugin Author Hakan Ozevin

    (@puckrobin)

    That function will only work for time slots.

    I am afraid there is no way to display free spaces in this configuration.

    Thread Starter heywatchoutdude

    (@heywatchoutdude)

    Is it maybe possible to display slots within the calendar?

    Plugin Author Hakan Ozevin

    (@puckrobin)

    In sample-custom-functions.php file of the recently uploaded version (V3.8.3), you will see a sample function app_monthly_calendar_html_after_td to display free and total available space in the monthly calendar.

    Alternatively, now you can use booking in Table View to display free and total spaces using the shortcode like:
    [app_book type=”table” columns=”date, day, time, seats_total, seats_left, seats_total_left, button”]

    Thread Starter heywatchoutdude

    (@heywatchoutdude)

    The custom function “app_monthly_calendar_html_after_td” works perfect, thanks!

    Additional question:
    When I set a value in “Late booking permission time (mins)” what is the starting point? Is it from 00:00 AM till 23:59 PM same day?
    If yes, with a value of “1140” (mins) it should allow/enable late booking till 19:00 PM, right?

    Plugin Author Hakan Ozevin

    (@puckrobin)

    When service duration is all day, you don’t need to set “Late booking permission time”.

    Client can always book until 23:59. It is like booking a hotel room.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Late booking isnt working’ is closed to new replies.