Appointments -- Is it possible to set a global capacity for all service providers?

I am setting up a site for a health studio with two rooms. There are about 10 practitioners, each with their own schedule which I can set up. However, I don't know how to tell the system to accept a maximum of two appointments at any given time.

For example: I set up three providers, each of whom provides one service -- an acupuncturist, a masseuse, and a pedicurist. They all share the same two rooms. say someone wants a massage on thursday at 12 p.m. and someone else wants a pedicure at the same time, both rooms are fully booked and I don't want to allow someone to book an acupuncture session at 12 p.m. on thursday. But there could then be an acupuncture and a pedicure at 1 p.m., and then a massage and a pedicure at 2 p.m.... hope this makes sense.

I'm a PHP developer so if it's possible to implement this with a custom function or a hacky workaround, I'm all ears. And if this situation is completely supported and I just didn't figure out how to do it yet, please accept my humble apologies :slight_smile:

Cheers

Jeremy

  • Charlie Pryor

    Hi jeremy_warne,

    I don't know your specific setup in the settings of the plugin, but you can actually set specific schedules with dummy providers.

    You can make a "dummy provider" (which is basically a user who can be real, or imaginary, whose notifications get sent to another user). If you made each room a dummy provider, you could set availability for those two rooms.

    Give that a shot, and see if this workflow works better for your purposes.

    Charlie

  • jeremy_warne

    I don't think I can do it like that because there are various real providers whose schedules need to be set. There's a guy who only works on Mondays, a guy who works wed-fri, and several who work all week, and so forth. The problem is that I can book three appointments for the same time slot; I want to set it up so that the maximum I can book in the same time slot is two. Would setting up dummy providers help me in this situation? If you can explain a little more that'd be great, but I suspect it's going to require a different solution.

  • jeremy_warne

    Think I might have found a solution here... if I change line 3847 from "get_workers_by_service($this->service_id)" to "get_workers()", then instead of only looking at appointments for this one service, I look at appointments across all services. Doesn't seem to affect performance too much (there are only a few workers total so a few more doesn't ruin my day) and at first glance it's doing what I want.

  • pxwm

    Hi Jeremy,

    I've been reviewing your requirements to see if I could identify a possible solution without you having to change the core code.

    Could you please confirm the following:-

    1. Does each Service Provider only offer one type of service?
    e.g. SP1 is an acupuncturist, SP2 is a masseuse, SP3 is a pedicurist

    If so then you may wish to try the following:-

    1. Set the service as the room name and set the capacity to '2'
    2. Set the Service Provider name followed by the service they offer
    e.g. SP1 - acupuncturist, SP2 -
    3. Then assign all three SPs to the service (room1)

    This should then allow the end user to select the service (room1) then select the relevant SP for the treatment (SP1 - acupuncturist) they require.

    If this works then at least you wouldn't have worry that your bespoke would work with any future upgrades.

    Please let me know if this would work for you and if so if you could test.

    Regards
    SteveB

  • jeremy_warne

    It would sort of work, but I have set up a couple of different services with different durations; doing it this way, if I'm not mistaken, would require each service to be the same duration. Also, I think there'll be a need to have multiple services for the same people at some point. I'm happy to keep it like this for now -- at least it works! Also I've had to mess around with a few other things in the code to get other abilities I wanted -- for example, there's one acupuncturist, but he can handle two clients at once, as long as the appointment start times are staggered by 15 minutes. Imagine my face when they told me that requirement :stuck_out_tongue: It'd be possible to incorporate my fixes into the code base -- by defining a service as "overlappable" (in my case I just specified the service IDs, but it'd be equally possible to check whether the service had this property), and by adding a setting for global capacity which chooses between the two lines of code I mentioned above -- but really, at a certain point I guess you've got to draw the line about how specific you want to let people get :slight_smile:

    I have to say the code's really clean and easy to follow; this sort of monkeying around would be impossible with most WP plugins! kudos to the developer(s).

    Cheers

    Jeremy

  • pxwm

    Hi Jeremy,

    Yes your are right that the service duration would have to be the same.

    However you could set up more than one service with difference service times.

    e.g. room1 - 30 mins, room1 - 45 mins.

    However this would possibly have to rely on the end user knowing how long the treatment takes.

    As for Servcie providers offering more than one service in the future then you could make use of the 'dummy' service provider feature.

    Anyway good news you have a solution.

    The only risk I see of changing the core coding is that with future upgrades your bespoke code would be overwritten and you would have to insert 'as-is'. Worse case scenario is that the upgrade means you have to start from scratch because your bespoke code no longer works.

    I'm trying to avoid any bespoke coding within the core application because of this and trying to make best use of the shortcodes.

    If our client requests features not in the 'out the box' solution I would consider submitting as a feature enhancement. This may take longer but at least this way you can be assured that any upgrades won't have an impact.

    Best of luck and if you make some useful feature enhancements it would be great if you could share.

    Regards
    SteveB

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.