Have flexible start times in Appointments+

I run a photo booth company. I am looking to set it so that clients can start an appointment at 30 minute intervals, but the nature of my business requires that the client be able to very specifically choose times - I don't really schedule back-to-back like a hair stylist might.

So, I'm checking to see if the following functionality exists:

1) The ability for the client to be able to select a specific start time within acceptable parameters (30 minute intervals that don't conflict with other schedules/padding)

2) The system to be able to recognize this and know what other appointments COULD be scheduled around it. Example:

A client books an event from 5pm-7pm. There is a 30 minute buffer on both sides.
For a 2 hour event, the latest early time would be 2pm (2 hours plus 30 minute buffer accounting the 30 minute buffer from the next event). But, it also included options for 1:30pm, 1pm, 12:30pm, etc...
The earliest late event would be 8pm (30 min buffer and considering last 30 min buffer).

3) If no such appointments are possible, the system recognizes this and notes the day as busy.

Thank you and let me know if you need any clarifications.

  • Scott

    I should probably be a little more clear. Let me give you another forum post that mostly covers my issue I found:

    https://premium.wpmudev.org/forums/topic/how-do-i-make-start-times-independent-of-the-length-of-the-service

    This example is in general what I am looking for. I followed the directions, and it works fine *IF* I don't include padding. Once I include padding, the times start to always include padding between start times. So instead of it listing the appointment possibilities as every 30 minutes, with a 30 minute pad at the beginning and end, it lists the appointment possibilities as every 90 minutes. For the padding to work properly, I will need the system to otherwise ignore padding unless there is an actual event scheduled, in which case it then pads that scheduled event only. How can I make that happen?

    In layman's terms, I go to people's events with my photo booth and set it up. It can take 30-60 minutes for me to drive somewhere and get everything set up, and another 30-60 to break down and drive back. So, if I'm not setting up somewhere for a time period, I certainly don't have to account for driving to and from and setting up/down somewhere.

    Hopefully that makes more sense.

    • Phillip

      Hi @Scott,

      I've been researching this for 30-45 minutes reading through different forum posts while trying to find a solution for myself. I've finally found one which combines steps from 2 different forum posts so I've combined them below.

      To make sure we're on the same page, here was my scenario (followed by how I fixed it).

      My scenario:
      I have 1 service provider. Appointments for the single service are 60 minutes in length. The provider needs an additional 60 minutes padding (after the appointment) to travel and prepare for the next appointment. What I wanted (and successfully have achieved with Appointments+) is for customers to choose a time that works best for them and then have the system block out the 2 hours.

      By default the system was allowing customers to schedule at 8:00, 10:00, 12:00, 2:00, or 4:00. I wanted a customer to see that he/she could schedule at 8:00, 8:15, 8:30, 8:45, 9:00, 9:15, etc. If someone booked the 8:15 appointment then the provider won't be done until 10:15.

      IF this is the functionality you are looking for try the following:

      [Go to Appointments plus >> Settings >> Addons]
      - Make sure the Padding add-on is disabled.
      - Enable the Durations add-on.

      [Go to Appointments plus >> Settings >> Services]
      - Set service duration for desired time to be blocked out (i.e., appointment length + padding length). In my example this is 120min.

      [Go to Appointments plus >> Settings >> General]
      - Change the "Time base (minutes)" to your amount of time you want start times to be staggered by. For my example using 8:00, 8:15, 8:30, 8:45, etc. you would use 15 minutes.
      - In the "Time Settings" section find "Time slot calculus method" and select "Minimum time based appointment duration calculus (legacy)"

      These settings make it work as explained, but with one problem: when booking an appointment customers are going to see the appointment time is whatever you listed the duration as (appointment time + padding length). To fix this:

      Insert the following code into your functions.php file (preferably inside of a child theme; more on that here: https://premium.wpmudev.org/blog/create-wordpress-child-theme/):

      function modify_duration_text( $text, $duration ) {
      	return ($duration -30) . ' minutes';
      }
      
      add_filter('app_confirmation_lasts', 'modify_duration_text', 10, 2);

      Note that where it says "30" above, you should enter the padding time you included in your duration.

      I hope that helps.

      Thanks to @PC and @Michael Bissett. The threads I pulled the info from are:
      https://premium.wpmudev.org/forums/topic/need-to-be-able-to-select-any-start-time-for-appointment
      https://premium.wpmudev.org/forums/topic/appointments-time-doesnt-work

  • PC

    Hey there,

    Thanks for posting back.

    For the padding to work properly, I will need the system to otherwise ignore padding unless there is an actual event scheduled, in which case it then pads that scheduled event only. How can I make that happen?

    That is actually true. I reckon it should ideally be an option for our user to choose if they want to apply padding to all the slots or only booked slots. That should sort a lot of issues out.

    I will need to discuss this directly with our lead developer as I think it should be a great addition to the plugin's features or if there is any other workaround to this.

    I have sent him a note and he should be around soon !

    Cheers, PC

  • PC

    Hiya,

    Thanks for standing by.

    I discussed this with Vlad and something like this won't work at the moment - the time increment step size is pre-determined, before we even go into iterating through the appointments.

    To get there, the whole timetable generation thing would need to be changed thoroughly. It would actually require a thorough rewrite of a portion of the plugin and has been noted down for a future version of the plugin.

    I have moved this to "Features and Feedback" so that Vlad can better track this.

    Cheers, PC

  • Jonathan

    Here's a crude fix, if it helps:

    Make sure the time calculus is set to 'Minimum time based appointment duration calculus (legacy)'

    Then in the appointments.php file on roughly line 2060, there's a for loop that generates the cells for the individual appointment slots.

    It looks like this:

    for ( $t=$first; $t<$last; $t=$t+$step ) {
            $ccs = apply_filters('app_ccs', $t); 				// Current cell starts
    			$cce = apply_filters('app_cce', $ccs + $step);

    Just before that line, you can add a variable
    $padding = 0;

    Then on line roughly 2220, the loop starts adding classes to cells based on whether the time slot is busy or not. Find the line that says:
    else if ( $is_busy )
    $class_name = 'busy';

    and change it to:

    else if ( $is_busy ) {
    				$padding = $padding + (15 * 60);
    				$class_name = 'busy';
    }

    (Assuming you want a 15min break, change '15' for the length of the break)

    Finally go back to the start of the for loop and change the 'Current Cell Starts' line to
    $ccs = apply_filters('app_ccs', $t + $padding);

    Any appointments following busy time slots will then have their start time delayed by the padding time you added.

    This might cause the working day to go on a bit longer than it should and appointments made before pre-booked time slots may not have enough padding time, but it's a start, anyway

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.