Block Scheduling with Appointment Plugin

I can't see to figure out how to use this plugin for block scheduling.

My client basically only has four available session start times each day.

9 am
10:45 am
1 pm
3:30 pm

She takes a lunch from 12:15 to 1. Each session is 90 min and then there is 15 min in between.

This plugin is the whole reason I joined mpmu so I'm really hoping I can use it. Any suggestions?

  • Hakan
    • The Incredible Smush

    Hi,

    A+ does not support such "sessions" starting at a strict time, when schedules are irregular (Here 90+15=105 minutes service time and 45 minutes break time make this schedule irregular). But it supports free selection of time slots whose durations are divisible by the same number (Here 15 minutes).

    First check and try this:

    - Set time base as 15 minutes.

    - Set a service with duration of 105 minutes (or modify existing default service).

    - Using working hours tab set Working hours start at 9:00 am and end 3:45pm. Set break hours start at 12:15 and end 1:00 pm.

    Now each appointment will take 105 minutes, but sessions do not need to start at particular hours, e.g. a client can pick up 9:30am.

    If this is not what you are looking for, still there is an alternative:

    - Set time base as 105 minutes. Set working hours as above. Don't set any break hours.

    - Using Google Calendar, add recurring events for each day for 12:15 to 1:00pm. Sync your calendar with A+. Then lunch times will be reserved.

    Note: There will be new update which handles such recurring events better, very soon. Please wait for that for the second case.

    Cheers,
    Hakan

  • JHFX
    • Flash Drive

    The first wouldn't work because if someone scheduled at 9:15 it would through off the whole day.

    The second doesn't work because if I set the base at 105 min then I don't have an option for a 9am appointment...only 8:45am.

    It doesn't sound like this plugin will work for me. When will the update be released?

  • Hakan
    • The Incredible Smush

    The second doesn't work because if I set the base at 105 min then I don't have an option for a 9am appointment...only 8:45am.

    Yes you can. Please read FAQ and you will see that there is an answer there:

    How can I force the schedules start at a non standard time, for example 9:15?
    Add these codes inside functions.php of your current theme (9.25 is not a typo; that is because 15/60=0.25):
    function new_starting_hour( $start ) {
    return 9.25;
    }
    add_filter( 'app_schedule_starting_hour', 'new_starting_hour' );

    I am writing this because there may be answers to your other possible questions in the FAQ tab.

    When will the update be released?

    in principle we don't give exact time for the release date. But just in a few days.

    It doesn't sound like this plugin will work for me.

    That is a possibility: we don't claim that we can cover 100% of the potential cases.. What are you using as a scheduler now? Can you give us a link?

    Cheers,
    Hakan

  • JHFX
    • Flash Drive

    Thanks for your reply Hakan,

    Your plugin really is the nicest I've seen for scheduling appointments and I've tested quite a few.

    The only plugin that I have found that easily allows for the type of block scheduling is the CP appointment calendar: http://wordpress.org/extend/plugins/cp-appointment-calendar/ However, it is not nearly as complete of a solution as yours.

    I'm hope that by trying these changes you pointed to, I can get it working. If I can't for some reason, would you be able to customize this plugin to work for me at an additional fee?

  • Hakan
    • The Incredible Smush

    JHFX,

    You can select 8:45 as starting time in the admin side. For the front end, it will be shifted 15 minutes further.

    I haven't noticed that 3:30 is another irregularity, but I found a solution for everything, I think. Please see attached screenshot.

    Also add these in functions.php:

    function add_some_minutes( $ccs ) {
    	if ( date( 'G', $ccs ) >= 14 )
    		return ( $ccs + 4500 );
    	if ( date( 'G', $ccs ) >= 12 )
    		return ( $ccs + 1800 );
    	else
    		return $ccs;
    }
    add_filter( 'app_ccs', 'add_some_minutes' );

    And add this to style.css of your theme:

    app_timetable_cell.notpossible.service_notpossible{display:none;}

    Set end time as 5:30pm.

    So now you have 9:00am, 10:45am, 1:00pm and 3:30pm time slots.

    I hope this helps,

    Cheers,
    Hakan

  • Hakan
    • The Incredible Smush

    And just one last thing to correct display of service duration time (For plugin it is 105, but for client it is 90 minutes):

    function modify_duration_text( $text, $duration ) {
    return '90 minutes';
    }
    add_filter('app_confirmation_lasts', 'modify_duration_text', 10, 2);
  • JHFX
    • Flash Drive

    Thanks Hakan!

    This might mess everything up but, what if my client needs to change her schedule after these modifications have to be made? She just told me her new schedule is going to look like:

    Mon & Fri

    9 am
    10:45 am
    1 pm
    3:30 pm

    Tues & Thurs
    1:30
    3:30
    4:45
    7:00

    Wed
    off

    Saturday
    9:45
    1:15
    3:00

    Sorry, if this changes every thing you just did. I'll understand if there is an additional fee involved to get this working for me.

  • Hakan
    • The Incredible Smush

    what if my client needs to change her schedule after these modifications have to be made?

    Of course she needs to modify the codes. These functions override some of admin side settings.

    You can extend the above sample by comparing which day slot ($ccs) belongs to, e.g:

    $day = date( "l", $ccs );
    if ( $day == "Saturday ) {
    // Use other rules based on above sample
    }
    if ( $day == "Tuesday" ||  $day == "Thursday" ) {
    // Use another set of rules
    }
    return $ccs;

    I'm not able to click on any days or times.

    It looks like you didn't use app_confirmation shortcode. As I cannot see February and next months, difficult to say. Please let the plugin create a page with 2 months schedule for you. Check "Create an Appointment page" check box and hit Save.

  • Hakan
    • The Incredible Smush

    To correct the styling, add this line to "additional css rules" setting field of A+:

    table {width:100%;}

    Not having any available slots is weird. Please check:
    1) Appointment limit (days) setting of A+
    2) Current date on Settings>General page of WordPress (maybe there is a problem with server clock)

    If you cannot find a solution please send me wp-admin credentials using our contact form:
    https://premium.wpmudev.org/contact/

    Please refer my name and give a link to this topic in the form.

    Cheers,
    Hakan

  • JHFX
    • Flash Drive

    Thanks again!

    I just sent you the admin credentials. I have to admit I'm a little lost on this part

    if ( date( 'G', $ccs ) >= 14 )
    return ( $ccs + 4500 );
    if ( date( 'G', $ccs ) >= 12 )
    return ( $ccs + 1800 );

    I think this is where you set it so that the Mon&Fri times would work, but I'm not sure what to put differently for Tues / Thurs & Sat.

  • Hakan
    • The Incredible Smush

    Hi,

    But you didn't check this:

    1) Appointment limit (days) setting of A+

    It was set to zero. I made it 365 and now everything is fine. However you may need to choose different colors for busy and not possible slots.

    G is time in 24 hour format. You are adding seconds after some hours to shift your slots up. Please make some arithmetic.

    Cheers,
    Hakan

  • JHFX
    • Flash Drive

    Thanks Hakan,
    I will try to do the math. I'm not sure what happened but now the times that are not available are showing up even though I added

    app_timetable_cell.notpossible.service_notpossible{display:none;}

    to the style.css

    Any suggestions?

  • JHFX
    • Flash Drive

    Okay, I'm feeling kinda dumb now. I apologize but I can't figure out how to get this to work and I guess it's beyond my skill level. I don't have a problem doing the math if I can just figure out what to change :slight_frown:

    $day = date( "l", $ccs );
    if ( $day == "Monday" ||  $day == "Friday" ) {
    
    if ( date( 'G', $ccs ) >= 14 )
    		return ( $ccs + 4500 );
    	if ( date( 'G', $ccs ) >= 12 )
    		return ( $ccs + 1800 );
    	else
    		return $ccs;
    }
    if ( $day == "Tuesday" ||  $day == "Thursday" ) {
    // Use another set of rules
    }
    if ( $day == "Saturday" ) {
    // Use another set of rules
    }
    return $ccs;
  • Hakan
    • The Incredible Smush

    You have a weird } in your style.css after where you added the line. So add only this to "additional css rules" setting field of A+ instead of style.css:

    .service_notpossible{display:none;}

    I will try to give full codes for you, but there is a problem for Tuesday and Thursday. There is only 75 minutes time for 3:30 session. Your service lasts 90 minutes. How is this possible?

  • Hakan
    • The Incredible Smush

    I assumed like this:
    Tues & Thurs
    1:30
    3:30
    5:00
    7:00

    Set working hours as follows:
    Tuesday & Thursday:
    12:15pm-9pm

    Other days:
    8:45am-5:30pm

    Here are the codes. Please make necessary fine tunings yourself.

    function add_some_minutes( $ccs ) {
    $day = date( "l", $ccs );
    $hour = date( 'G', $ccs );
    if ( $day == "Monday" ||  $day == "Friday" ) {
    	if ( $hour >= 14 )
    		return ( $ccs + 4500 );
    	if ( $hour >= 12 )
    		return ( $ccs + 1800 );
    }
    if ( $day == "Tuesday" ||  $day == "Thursday" ) {
    	if ( $hour >= 17 )
    		return ( $ccs + 4500 );
    	if ( $hour >= 16 )
    		return ( $ccs + 3600 );
    	if ( $hour >= 14 )
    		return ( $ccs + 4500 );
    	if ( $hour >= 12 )
    		return ( $ccs + 3600 );
    }
    if ( $day == "Saturday" ) {
    	if ( $hour >= 10 )
    		return ( $ccs + 9000 );
    	if ( $hour >= 8 )
    		return ( $ccs + 2700 );
    }
    return $ccs;
    }
    add_filter( 'app_ccs', 'add_some_minutes' );

    Tested and working. See attached screenshots.

    Note: You cannot use this in weekly calendar, as there is no common hours column.

  • JHFX
    • Flash Drive

    I must be doing something wrong...when I add this it breaks my them. Do I need to delete what was there before? Here is what I put:

    function new_starting_hour( $start ) {
    return 9.00;
    }
    add_filter( 'app_schedule_starting_hour', 'new_starting_hour' );
    
    function add_some_minutes( $ccs ) {
    	if ( date( 'G', $ccs ) >= 14 )
    		return ( $ccs + 4500 );
    	if ( date( 'G', $ccs ) >= 12 )
    		return ( $ccs + 1800 );
    	else
    		return $ccs;
    }
    add_filter( 'app_ccs', 'add_some_minutes' );
    
    function add_some_minutes( $ccs ) {
    $day = date( "l", $ccs );
    $hour = date( 'G', $ccs );
    if ( $day == "Monday" ||  $day == "Friday" ) {
    	if ( $hour >= 14 )
    		return ( $ccs + 4500 );
    	if ( $hour >= 12 )
    		return ( $ccs + 1800 );
    }
    if ( $day == "Tuesday" ||  $day == "Thursday" ) {
    	if ( $hour >= 17 )
    		return ( $ccs + 4500 );
    	if ( $hour >= 16 )
    		return ( $ccs + 3600 );
    	if ( $hour >= 14 )
    		return ( $ccs + 4500 );
    	if ( $hour >= 12 )
    		return ( $ccs + 3600 );
    }
    if ( $day == "Saturday" ) {
    	if ( $hour >= 10 )
    		return ( $ccs + 9000 );
    	if ( $hour >= 8 )
    		return ( $ccs + 2700 );
    }
    return $ccs;
    }
    add_filter( 'app_ccs', 'add_some_minutes' );
  • JHFX
    • Flash Drive

    Man...sorry. I don't know why I cant get my times to match yours. I'm attaching some screen shots. I think I have followed your instructions. I was hoping to mark this closed :slight_frown:

    Thanks again for your patience in helping me.

  • Hakan
    • The Incredible Smush

    This should be there also:

    function new_starting_hour( $start ) {
    return 9.00;
    }
    add_filter( 'app_schedule_starting_hour', 'new_starting_hour' );

    When I said remove everything and add those in my last message I meant it about the error you are receiving. I couldn't express myself.

  • JHFX
    • Flash Drive

    After all that, my client decided it was too complicated for her to keep her appointments online (she's a bit older). So unfortunately I don't have a link to share. I think I just have to ease her back into it. If I can convince her in the future I will certainly share. Thanks for all of the hard work and help!

    Justin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.