Appointments+ Appointment times needed 15, 20. 30. and 60 minutes.

My client just added another service where she needs 20 minute appointments. Until now I have set the time to 15 minutes since all her other appointments fit the 15 min (except the 8 hour block which I also can't find a fix for). When I set the additional time base to 10 minutes I loose the ability to have 15 minute appointments. If I set it to 15 then I can't do the new 20 minute option. Please help!

  • Vinod Dalvi

    Hi @voltaicrose,

    I hope you are well today and thank you for your question.

    It's possible to have 2 different services with different start times, yes. The only problem here is that your start times are so close together that there isn't a time base that we can use to fit them. We would need a time base of 5 minutes so that it can cover both of your 15 minutes and 20 minutes appointments but the lowest possible base is 10 minutes.

    So we have to develop custom code hooking the filter app_selectable_durations and some other hook so achieve this so i have notified the SLS developer to get his valuable reply regarding this to achieve it.

    He will reply here ASAP but please keep in mind though that plugin developers have a lot of responsibilities so this might take a bit longer than a normal ticket.

    Thanks,
    Vinod Dalvi

  • Hoang Ngo

    Hi @voltaicrose,

    I hope you are well today.

    We can achieve this by enable the add-on Paddings. And set the time base is 10 minutes.

    Now, we will set the service 1 (15 minutes) as 10 minutes and service 2 (20 minutes) is 20 minutes.

    We are close now, for the service 1, please click on the more info link, and add padding after 5 minutes, please check my screenshot.

    Now, at the frontend, you will see the calendar displaying right amount. However, when you click on the 15 mins slot, the details show up will tell this appointment only for 10 minutes. To fix that, please add this code to your theme functions.php or use mu-plugins

    add_filter( 'app_confirmation_lasts', 'update_the_final_duration', 10, 2 );
    function update_the_final_duration( $text, $duration ) {
    	if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
    		$value = $_POST['value'];
    		$data  = explode( ':', $value );
    		//get the padding services
    		$paddings = get_option( 'appointments_services_padding' );
    		if ( is_array( $data ) && is_array( $paddings ) && count( $paddings ) && isset( $paddings[$data[1]] ) ) {
    			$padding = $paddings[$data[1]];
    			$text    = ($padding['after'] + $duration) . ' ' . __( 'minutes', 'appointments' );
    			return $text;
    		}
    	}
    	return $text;
    }

    If you have any additional issues, please let us know and we'll be happy to help.

    Best regards,
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.