How to support 5 minute appointment

Hi
I need your help with a few problems I am facing:
1. Our most common appointment is a 5 minute appointment although we have other timings.

Can you please tell me how to activate 5 minute appointments.

Alternately, can you tell us how to allow double booking (upto 2 times) for each appointment slot

2. When using [app_all_appointments], how do I show the date/time when the appointment was booked?

Thanks
Vandana

  • Vinod Dalvi
    • WP Unicorn

    Hi Vandana,

    Welcome to the WPMU Dev community and thank you for your questions.

    1. Our most common appointment is a 5 minute appointment although we have other timings.

    Can you please tell me how to activate 5 minute appointments.

    You can create 5 minute appointments by adding 5 in the Appointments + "Additional time base (minutes)" option and selection 5 in the dropdown of "Time base (minutes)" option on the following path in Appointments + Time Settings.

    Admin Area -> Appointments+ -> Settings -> General -> Time Settings

    Add the following code in the functions.php file of your child theme.

    function app_custom_safe_time()  {
    	return 5;
    }
    add_filter('app_safe_time','app_custom_safe_time');

    Then create a service having 5 minutes duration on the following path.

    Admin Area -> Appointments+ -> Settings -> Services

    Alternately, can you tell us how to allow double booking (upto 2 times) for each appointment slot

    You can achieve this by adding 2 in the capacity field of that service in the Appointments services settings as displayed in the attached screenshot.

    2. When using [app_all_appointments], how do I show the date/time when the appointment was booked?

    To show the date/time when the appointment was booked try adding the following code in the functions.php file of your theme.

    add_filter('app_all_appointments_column_name','incsub_appt_add_field_display_col_name');
    function incsub_appt_add_field_display_col_name($head_html){
    	// Repeat the following line for headers/column names
    	$head_html .= '<th class=&quot;all-appointments-created&quot;>' . __('Created', 'appointments' ) . '</th>';
    
    	return $head_html;
    }
    
    add_filter('app-shortcode-all_appointments-after_status','incsub_appt_add_field_display_field_value',99,2);
    function incsub_appt_add_field_display_field_value($x,$appointment){
    
    	//repeat the following line for each extra fields, replacing hometeam with appropriate values
    	$extra_html .= '<td>'.$appointment->created.'</td>';
    
    	return $extra_html;
    }

    Best Regards,
    Vinod Dalvi

  • vandana
    • Design Lord, Child of Thor

    Thanks Vinod.

    I went with the alternative on the first question and the second question worked well. Is there anyway we could change the order of the columns to insert this before or after the Appointment date/time.

    Also I would like to not show the seconds for the Appointment time if that is possible.

    • Vinod Dalvi
      • WP Unicorn

      Hi Vandana,

      The seconds for the Appointment time is displayed in the format HH:MM:SS like 08:14:40 as shown in the attached screenshot.

      To change the order of the columns to insert this after the Appointment date/time try using the following code.

      add_filter('app_all_appointments_column_name','incsub_appt_add_field_display_col_name');
      function incsub_appt_add_field_display_col_name($head_html){
      	// Repeat the following line for headers/column names
      	$head_html = '<th class="all-appointments-service">'. __('Service', 'appointments' )
      			. '</th><th class="all-appointments-provider">' . __('Provider', 'appointments' )
      			. '</th><th class="all-appointments-client">' . __('Client', 'appointments' )
      			. '</th><th class="all-appointments-date">' . __('Date/time', 'appointments' )
      			. '<th class="all-appointments-created">' . __('Created', 'appointments' ) . '</th>'
      			. '</th><th class="all-appointments-status">' . __('Status', 'appointments' ) . '</th>';
      
      	return $head_html;
      }
      
      add_filter('app-shortcode-all_appointments-after_date','incsub_appt_add_field_display_field_value',99,2);
      function incsub_appt_add_field_display_field_value($x,$appointment){
      
      	//repeat the following line for each extra fields, replacing hometeam with appropriate values
      	$extra_html .= '<td>'.$appointment->created.'</td>';
      
      	return $extra_html;
      }

      Cheers,
      Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Vandana,

    Thank you for your patience.

    To show Created Date/Time for the app_my_appointments shortcode also try using the following code the same way as the previously provided code.

    add_filter('app_my_appointments_column_name','incsub_my_appt_add_field_display_col_name');
    function incsub_my_appt_add_field_display_col_name($head_html){
    	if ( !$provider ) {
    		$provider_or_client = __('Provider', 'appointments' );
    	}else{
    		$provider_or_client = __('Client', 'appointments' );
    	}
    	// Repeat the following line for headers/column names
    	$head_html = '<th class="my-appointments-service">'. __('Service', 'appointments' )
    		. '</th><th class="my-appointments-worker">' . $provider_or_client
    		. '</th><th class="my-appointments-date">' . __('Date/time', 'appointments' )
    		. '<th class="all-appointments-created">' . __('Created', 'appointments' ) . '</th>'
    		. '</th><th class="my-appointments-status">' . __('Status', 'appointments' ) . '</th>';
    
    	return $head_html;
    }
    
    add_filter('app-shortcode-my_appointments-after_date','incsub_my_appt_add_field_display_field_value',99,2);
    function incsub_my_appt_add_field_display_field_value($x,$appointment){
    
    	//repeat the following line for each extra fields, replacing hometeam with appropriate values
    	$extra_html .= '<td>'.$appointment->created.'</td>';
    
    	return $extra_html;
    }

    Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.