How do I increase capacity for each time slot? Also reports for service providers.

Hello
I would like to allow two appointments for each time slot for two of our service providers. I tried amending the Services page of Settings by typing 2 in the box that defaults to 0. The explanation on this settings page says ' Capacity is the number of customers that can take the service at the same time. Enter 0 for no specific limit (Limited to number of service providers, or to 1 if no service provider is defined for that service).' But when I changed this to 2, I could still only book one appointment per slot.
I also tried setting up another service provider for that venue in the hopes that it would allow more than one booking per slot but this just caused loads of problems with the exceptions data so I had to delete it all.
Please can you give me simple instructions on increasing capacity.

Also our service providers are asking for reports of appointments made. I can download all the appointments and email this to them as an attachment but is there any way of doing this on our website or automatically?

Many thanks, Joseph

  • Adam Czajczyk

    Hello Joseph,

    I hope you're well today and thank you for your question!

    The "Capacity" option was designed to limit maximum capacity of the time slot and doesn't allow you to increase it. By default, the maximum capacity of the time slot is either 1 (if there's no service providers assigned to it) or the number of service providers handling this service.

    There are cases though when despite e.g. 3 service providers available you need to limit booking availability for example due to the technical reasons. A real live example: there are 3 driving instructors at work at the time but 2 out of 3 cars got broken so there's only a single one available.

    In order to increase capacity of a service, you will want to use a little "hack" that's described in "Appointments+ FAQ" (in your dashboard) in "Advanced" section:

    The simplest solution would be to add "dummy" service providers (up to the number of needed capacity minus the number of already assigned "real" service providers). This will automatically increase capacity number (if capacity option is set to "0") to the number of service providers assigned to it. It will not however let your "real" service providers easily track their appointments.

    Therefore, there's another way to do this. Add these codes in functions.php and modify as required:

    function increase_capacity( $capacity, $service_id, $worker_id ) {
    		return 10;
    	}
    	add_filter( 'app_get_capacity', 'increase_capacity', 10, 3 );

    That's a "general" code that will affect all services. In order to target only a selected service, please note down IDs of these services and give this code a try:

    function increase_capacity( $capacity, $service_id, $worker_id ) {
    if ($service_id == 8) {
    		return 10;
    }
    else {
    return $capacity;
    }
    	}
    	add_filter( 'app_get_capacity', 'increase_capacity', 10, 3 );

    This code should increase capacity to "10" only for service of ID "8" and keep capacity on default level for all other services.

    Also our service providers are asking for reports of appointments made. I can download all the appointments and email this to them as an attachment but is there any way of doing this on our website or automatically?

    The "view" capabilities are based on WP user roles. That said, please make sure that all the service providers (and only them) are assigned the same, selected WP user-role (e.g. "Contributor") first. You may also consider creating a custom user role for service providers with a little help from "User Role Editor" plugin

    Then, please go to your dashboard's "Appointments -> Settings page -> General tab" and scroll down to "Appointments role access" section and select that role from role list under "Appointments page" label. This should let your service providers access "Appointments -> Appointments" page from their dashboards so they'd be able to see what's booked for them.

    I hope that helps!
    Best regards,
    Adam

  • Joseph

    Thank you for your help Adam. I have tried creating a dummy service provider but I then could not set the exceptions to work even though I copied the exceptions for the original service provider at the same service. So I had to delete everything to get the calendar showing the right dates again.

    I'm afraid I don't yet have the skills to change the code and dare not learn on this website!

    We have thought of another option, which is to change the session time from 60 mins to 30 mins, and to run hour long sessions starting at 30 minute intervals. But if we make this change, will this affect the appointments we already have booked? Is there a way of backing up the appointments before we make this change?
    Many thanks, Joseph

  • Neil

    Hi!

    Am trying to insert the above code to my functions.php file, where the service id for my service is 3.

    function increase_capacity( $capacity, $service_id, $worker_id ) {
    if ($service_id == 3) {
    return 10;
    }
    else {
    return $capacity;
    }
    }
    add_filter( 'app_get_capacity', 'increase_capacity', 10, 3 );

    However, am not able to save the php file. It returns an error saying server didn't respond. Am entering this at the very bottom of the functions.php file.
    Am I doing this wrong?
    PS - Am on a multisite

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.