Custom Scheduling / Block Scheduling / Custom Times / Documentation

Can you please provide some documentation on how to make custom scheduling times? For example I want to start at:

7:30am
10:30am
1:00pm
4:00pm

Each appointment is 2:30hrs / 150min.

We have a semi-detailed solution here

Could you just provide some more documentation so I can make changes as necessary?

Here is the specific code that I would assume is needed - some documentation on how it works / how one could change it to suit their own needs.

function add_some_minutes( $ccs ) {
	if ( date( 'G', $ccs ) >= 14 )
		return ( $ccs + 1200 );
	if ( date( 'G', $ccs ) >= 12 )
		return ( $ccs + 1800 );
	else
		return $ccs;
}
add_filter( 'app_ccs', 'add_some_minutes' );
  • pxwm
    • WP Core Meltdown

    Hi @sletts02

    If I've understood your requirement correctly then you may wish to consider trying the proposal in the following post. There is also a further link within this post to the original coding proposal.
    You may have to consider changing some of the values as you want the start time to be on the half hour and not the hour.
    Suggest you will also have to consider how best to set the A+:-

    'Time Period' in the 'General' tab
    'Working Hours' tab
    The actual services duration in the 'Services' tab

    https://premium.wpmudev.org/forums/topic/i-want-to-sell-a-service-at-home-this-service-has-two

    Please let me know how you get on and more than happy to assist with the setup

    Regards
    SteveB

    Please let me

  • sletts02
    • WPMU DEV Initiate

    I'm not quite sure if that is what I am looking for, all my services have the same duration. As far as I can tell I just need some support/documentation with these functions:

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

    I want to have start times. Take the example I gave with 150min blocks:
    7:30am
    10:30am
    1:00pm
    4:00pm

    Appointments+ defaults to 7:30 -> 10:00 -> 12:30 -> 15:00 etc. I need it to start at the above times and the above code seems to be the solution. Just a bit of documentation so I can understand how the functions are working.

  • Vaughan
    • Support/SLS MockingJay

    hiya @sletts02

    thanks for the post.

    i'm not entirely sure i understood fully. i have read the thread you linked to. that may work on the front end. Hakan posted it so it should still function. it's a detailed thread though.

    sorry, i haven't looked into @pxwm thread but looks like it achieves similar.

    thanks.

  • sletts02
    • WPMU DEV Initiate

    @pxwm In original post I linked to here: https://premium.wpmudev.org/forums/topic/block-scheduling-with-appointment-plugin

    @Vaughan As far as I can tell the pxwm thread doesn't help my situation unfortunately.

    How do you PM someone? It would be great to have Hakan chime in with his thoughts. The original code is great, and if I spent a while I could probably get my head around it, but was hoping to get some faster support as I am not a coder.

  • pxwm
    • WP Core Meltdown

    Hi @sletts02

    Have you considered the following as an alternative to bespoke coding:-

    Create 1 x 'real' service provider and set their working hours to 07hr30 to 10hr00
    Then create 3 x 'dummy' service providers with their working hours as:-
    'dummy1' 10hr30 to 13hr00
    'dummy2' 13hr00 to 15hr30
    'dummy3' 16hr00 to 18hr30
    Then assign the 'dummy' service providers to the 'real' service provider in the A+ 'General' tab
    Then create the single service, set to 150mins and then assign all 4 x service providers tot he single service
    Then set the time period to 30mins. You will have to set to 30mins as the start time of your appointments vary between the hour and half hour.
    If you set the schedule to the monthly calendar this is more presentable than the weekly calendar for this situation.

    As you have one service you could even include shortcodes to automatically select the service so the user will only have select the service provider for the appropriate appointment slot.

    Hope that helps
    Regards
    SteveB

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.