Appointments Plus Time Problems

I have a client that has 2 service providers. They work on different days each have set appointment times that last for 60 minutes each.

Provider 1 works Monday to Thursday and takes appointments at 8.30am, 9.30am, 10.30am etc. She also has a 1 hour break for lunch.

Provider 2 works on Friday and Saturday. On Friday she takes appointments at 9am, (followed by a 30 minute break to review), 10.30am (followed by a 30 minute break to review), 12pm (followed by a 30 minute break to review) and so on. She also has a 1 hour lunch break. On Saturday she doesn’t have breaks between appointments and consults at 9am, 10am, 11am etc.

I can’t get this to work properly at all! Using the “Minimum time based appointment duration calculus” it allows the breaks etc. but also allows people to book in half hour increments. This won’t work for the client as they have set appointment times (8.30am, 9.30am etc.) so if someone is allowed to book at 9am, it stuffs up their schedule.

I thought using “Service duration based calculus” would work, but it doesn’t. It makes my first provider’s start time at 9am for some reason, instead of 8.30am and doesn’t display the breaks correctly.

I’ve spent hours stuffing around with this (as have other staff members) and signed up again so I could download an updated version of the plugin that allows multiple breaks and I’m just about ready to tell my client that we’re not doing this anymore.

After speaking with someone from the support team I thought I had it worked out and made the time base 60minutes and the admin time base 30mintures (so I could add in the 30minute breaks). I think this should have worked but it didn't. For starters it's not even letting the first service provider on Monday to Thursday start at 8.30am and work until 3.30pm. The time base is 60 minutes and all her appointments are 60 minutes and her break it 60minutes. It just forces the start times to be on the hour (9am) for some reason, which doesn't make sense at all. Her schedule is very basic and straight forward. Everything is 60 minutes.

I have a feeling something is going wrong with the plugin!

  • pxwm

    Hi @aristath - Hope you don't mind me chiming in

    Hi @Stephanie

    I'm trying this out on my demo site and I've managed to get it working for your Provider1 who takes appointments on the half hour.

    However to achieve this I have had to add some bespoke code to the functions.php, which is part of the theme.

    I can confirm with the bespoke code only appointment can be made on the half hour.

    I'm now working on Provider2 who takes appointments on the hour but this is proving a bit tricky as currently it also allows appointment on the hour and half hour.

    To assist with my testing I would appreciate if you could provide the following information for Provider1

    Provider 1 works Monday to Thursday and takes appointments at 8.30am, 9.30am, 10.30am etc. She also has a 1 hour break for lunch.

    Provider1
    Assuming their start time is 08h30 could you confirm their end time?
    Could you confirm the start and end time of their lunch break?

    For Provider2
    Assuming their start time is 09h00 could you confirm their end time?
    Could you confirm the start and end time of their lunch break on the Friday?

    Services
    Just to confirm is:-

    Provider1 assigned to a single Service?
    Provider2 assigned a different single Service?

    I'll keep you posted.

    However just for information I detailed below some of the reasons why it doesn't work with your settings:-

    A+ calculates available time slots starting from midnight.
    Therefore when you set the 'Time Base' rule to 'Service duration based calculus' the time slots will be calculated using the duration of the Service.
    As your Services are set to 60mins it means that the available slots will be:-

    00h00, 01h00, 02h00 etc
    Which means it wouldn't work if you wanted Provider1 to take appointments on the half hour.

    As you have proved if you set the 'Time Base' to use 'Minimum time based appointment duration calculus' this will set the appointment slots based on the value set in the 'Time Base' field in the 'General' tab.
    However if you set it to 30mins so you can take appointments on the half hour it will also allow appointments on the hour as you have indicated in your post.
    However using some bespoke code I can 'force' it to only allow appointments to be taken on the half hour.

    Hope this helps
    Regards
    SteveB

  • Stephanie

    Thanks pxwm & aristath!

    I'm still not sure why the providers aren't allowed to start at the half hour if the time base is 60 minutes. It doesn't make sense to me, as most businesses start at 8.30am and the appointment lengths are all 60minutes (and the break). I'm not expert but from a user's point of view it seems a bit silly and would make this plugin unusable for most of the businesses I know and work for, myself included. You should able able to start and finish at whatever time you want as long as the breaks and appointments all fit into your time base.

    There is one service which is 60 minutes. Both providers use the same service.

    Provider one: Rachael.

    Working days: Monday - Thursday
    Start time: 8.30am
    Finish time: 3.30pm
    Break time: 12.30pm-1.30pm
    Consulting times: 8.30am, 9.30am, 10.30am and 11.30am then 1.30pm, 2.30pm

    Provider two: Janet

    Working days: Friday & Saturday (different schedule for each day)

    Friday Schedule for Janet
    Start time: 9am
    Finish time: 5pm
    Break times: Lunch: 1pm - 2pm. On Friday's ONLY Janet has 30 minute breaks after each appointment. The appointments are the same, 60 minute service (there is only one service).
    Consultation times: 9am, 10.30am, 12pm, 2pm, 3.30pm

    Saturday Schedule for Janet
    Start time: 9am
    Finish time: 1pm
    Break times: None
    Consultation times: 9am 10am, 11am 12pm

    Screen shots attached.

    I feel like this shouldn't be as complicated as it is. It seems like a pretty standard schedule to me (with exception of the 30 minute breaks on Friday's for Janet, but that's not the only issue here).

    I appreciate all the help! I'm out of ideas! Thank you.

  • pxwm

    Hi @Stephanie

    Good news!

    It appears to be working on my demo site and before I provide you with the bespoke code and the settings within A+ you may wish to try it out.

    To confirm there is:-

    One Service called 'Psychology Consultation (50 minutes)'
    Two Service Providers called 'Service Provider 1' = Rachael and 'Service Provider 2' = Janet

    The site is at: http://appoint.pxwm.co.uk/
    Then select 'Appointments' in the main menu

    You can make an appointment and you should receive a Confirmation email

    The formatting may be out a bit because I'm using a default theme

    Please let me know if this works for you and if it matches your requirements?

    If it does could you please confirm the following:-

    The ID of Provider1 - Rachael
    The ID of Provider2 - Janet
    Can be found in the 'Service Providers' tab

    The ID of the single Service - Can be found in the 'Services' tab

    Regards
    SteveB

  • pxwm

    Hi @Stephanie

    Sorry for the delay but I've been away for the weekend.

    I've listed below the settings and the bespoke code.

    As always I suggest you take a backup of your site and database before making the changes and adding the bespoke code so you have a rollback option.

    A+ Setting Changes
    Login to your Wordpress dashboard using Admin
    Select A+ Settings
    Select 'Add-ons' tab
    Check if the 'Durations' add-on has been activated
    If not Activate

    Then Select the 'General' tab
    Set the 'Time Base' to 30mins
    Set the 'Time slot calculus method' field to 'Minimum time based appointment duration calculus (legacy)'
    Save settings

    Select 'Working Hours' tab
    Select 'no specific provider' from the dropdown and set 'Work?' field for each day to 'No'
    Then Save
    Select 'Provider1' - Rachael to:-
    For Working Hours
    Set 'Work?' field for Mon - Thurs to 'Yes'
    Set the 'Start Time' as 08h30am for each day
    Set the 'End Time' as 04:30pm for each day
    For break Hours
    Set 'Give break?' field for Mon - Thurs to 'Yes'
    Set the 'Start Time' as 12h30pm for each day
    Set the 'End Time' as 1:30pm for each day
    Then Save

    Select 'Provider2' - Janet to:-
    For Working Hours
    For Friday
    Set 'Work?' field to 'Yes'
    Set 'Start Time' to 09h00am
    Set 'End Time' to 05:00pm
    For break Hours
    Set 'Give break?' field to 'Yes'
    Set Multiple Break times as:-
    'Start Time' and 'End Time' to 10h00am to 10h30am
    You may have to save and it then should display a '+'
    Click the plus then set the other Break Times
    'Start Time' and 'End Time' to 11h30am to 12h00am
    'Start Time' and 'End Time' to 1h00pm to 2h00pm
    'Start Time' and 'End Time' to 3h00pm to 3h30pm
    'Start Time' and 'End Time' to 4h30pm to 5h00pm
    Then Save
    For Saturday
    Set 'Work?' field to 'Yes'
    Set 'Start Time' to 09h00am
    Set 'End Time' to 01:00pm
    For break Hours
    Set 'Give break?' field to 'No'
    Then Save

    Bespoke code
    Add bespoke code at the bottom of the functions.php file

    Please Note1: You will have to identify the 'Service' ID and this can be found by selecting the 'Services' tab and the ID will on the far left.
    Then replace 'X' with the ID for the Service

    Please Note2: You will have to identify the 'Service Provider' IDs and this can be found by selecting the 'Service Providers' tab and the ID will on the far left.
    Then replace the 'Y' with the ID of Provider1 - Rachael
    And replace 'Z' with the ID of Provider2 - Janet

    function modify_for_service( $class_name, $ccs, $cce) {
    // Replace X with your service ID for the Service assigned to Provider1 and Provider2

    global $appointments;
    //$service_id= $appointments->service;
    //$worker_id= $appointments->worker;

    if ( X != $appointments->service) {
    return $class_name;
    }

    // Check if $ccs divisible by 0 which means 1hr
    // Replace Z with the ID of Provider2 - Janet
    if (( $ccs % 3600 == 0) && (Z == $appointments->worker) && ( 'Saturday' == date( 'l', $ccs ))) {
    return $class_name;
    } elseif ((Z == $appointments->worker) && ( 'Saturday' != date( 'l', $ccs ))) {
    return $class_name;
    }

    // Check if $ccs divisible by 1800 which means 30mins
    // Replace Y with the ID of Provider1 - Rachael
    if (( $ccs % 3600 == 1800) && (Y == $appointments->worker)) {
    return $class_name;
    }
    return 'app_hide';
    }
    add_filter( 'app_class_name', 'modify_for_service', 10, 3 );

    Hope this helps
    Regards
    SteveB

  • pxwm

    Hi @Stephanie

    Apologies forgot to add the following:-

    Login to your Wordpress dashboard as Admin
    Select A+ Settings
    Select 'General' tab
    Scroll down to 'Additional css Rules' field and enter

    .app_hide{display:none;}

    Then Save
    This should 'Hide' the majority of the unavailable times

    As for Janet's times, could you please confirm if it is working fine for Rachael?

    If so could you please screenpost the following:-

    The 'Working Hours' tab for Janet

    Regards
    SteveB

  • pxwm

    Hi @Stephanie

    Sorry to hear you are still having problems.
    I've checked the settings and look okay.
    I've checked my demo and it all appears to be working fine.

    I'm more than happy to login using a temporary Admin user profile.

    However just to make you aware I'm only an wpmu member and not a member of staff.

    If you are still happy to provide with with a temporary Admin access then please email to steve.billington@pxwm.co.uk.

    Could you also please send the admin login url
    And also confirm if the site is live?

    Regards
    SteveB

  • pxwm

    Hi @Stephanie

    Before you provide any login details could you please try the following to 'hide' the 'not possible' times

    Login to your Wordpress dashboard as Admin
    Select A+ Settings
    Select 'General' tab
    Scroll down to 'Additional css Rules' field and delete current rules in the field and then add the following:-

    .app_hide, .app_break, .service_notpossible {display:none !important;}

    Then Save

    This should then 'hide' all future 'not available' times.
    The only times that will show as 'not available' will be for past times.

    Hopefully this works and then we only have your issue with the Service times for Janet on Saturday

    Regards
    SteveB

  • pxwm

    Hi @Stephanie

    Really pleased that worked.

    Yes, I'm more than happy to check your settings if you are happy to set me up a temporary admin login.

    Just to confirm I'm only an wpmu member and not a member of staff.

    If you are still happy to provide with with a temporary Admin access then please email to steve.billington@pxwm.co.uk.

    Could you also please send the admin login url
    And also confirm if the site is live?

    Regards
    SteveB

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.