2 services with different start & start-intervals

I'm trying to define two services, ServiceA & ServiceB.

ServiceA lasts for 45 minutes and starts every 10 minutes from 6:00am until 8:30am as well as from 4pm to 6:15pm. Up to 3 people can join Service A per start.

ServiceB lasts for 60 minutes and starts every 15 minutes (except at 45 minutes past the hour) from 7:00am until 8:30am as well as from 4pm until 6:00pm.

I can't seem to be able to define a calendar that, for Service a will show:

6:00am - 6:10am
6:10am - 6:20am
6:20am - 6:30am
6:30am - 6:40am
6:40am - 6:50am
7:00am - 7:10am
7:10am - 7:20am, etc until;
8:30am - 8:40am.

For Service B:
7:00am - 7:15am
7:15am - 7:30am
7:30am - 7:45am
8:00am - 8:15am
8:15am - 8:30am
8:30am - 8:45am
9:00am - 9:15am, etc

I have 1 service provider and 2 dummies for Service B. The working hour for the service provider starts at :00am. The working hours for dummy 1 & dummy 2 starts at :15am and :30am respectively.

But the app_service calendar still displays the :45am option, even though with the duration (60 minutes) and the start-time, those slots should not be "available" (no resources, afik).

BTW, is this even possible to do - having 2 different services with different calendar start times, etc?

• Tyler Postle

Hey Thomas,

Hope you're doing well today and thanks for your question!

It's possible to have 2 different services with different start times, yes. The only problem here is that your start times are so close together that there isn't a time base that we can use to fit them. We would need a time base of 5 minutes, but the lowest possible base is 10 minutes.

If you have 3 service providers set for service A and have a time base of 10 minutes while the service length is 60 minutes, then you can activate the "durations" Add-on and navigate to your general settings in appointments and change the Time Slot calculus method to: Minimum time "based appointment duration calculus (legacy)"

That will allow an appointment at every 10 minute interval.

As for service B, it might still be possible if you use the "padding" add-on and add on 5 minutes to the tail end of a new service, then It will add 5 minutes on to the duration and possible give you the time range you're after.

Can you grant support access so I can see what your current settings look like? If you don't mind then You can grant support access via admin dashboard - WPMU DEV > Support > Support Access > Grant Access.

Look forward to hearing back!

All the best,
Tyler

• thomas_sjolshagen

Hi Tyler,

I'm not sure I understand... So just to (hopefully) clarify what I'm looking for:

ServiceA lasts 45-50 minutes and should start every 10 minutes (from 6am - 7am it should be possible to book a start at 6:00, 6:10, 6:20, 6:30, 6:40 and 6:50. I've got 1 service provider and 5 dummy service providers with work hours that start at 6:00, 6:10, 6:20, etc respectively) with the service capacity at 3 per service session.

ServiceB lasts 60 minutes and only 3 of them start per hour, every 15 minutes, from 7:00, 7:15 and 7:30. Note that there is _NOT_ supposed to be a 6:45 appointment available. To configure, I have one Service provider and 2 dummy providers with work hours that start at 7:00, 7:15 and 7:30 and end at 7:00pm, 6:15pm, 6:30pm respectively. This service has a capacity of 1 per session/appointment. The service providers have breaks configured from 9:00am - 4:00pm, 9:15 - 4pm, 9:30am - 4:15pm respectively.

I have a Time Base of 10 minutes in General Settings with "Minimum time based appointment duration calculus (legacy)", "Exact period matching", "Shift next period" and Padding resolution type = Cumulative.

When viewing the weekly schedule for ServiceB, the time slots are visible are every 30 minutes, starting at 7:00. So, in the weekly view, I see 7:00, 7:30, 8:00 and then 4:00, 4:30, 5:00, 5:30, 6:00, 6:30. For ServiceB I'm wanting to see:

7:00, 7:15, 7:30, 8:00, 8:15, 8:30, 4:00, 4:15, 4:30, 5:00, 5:15, 5:30, 6:00.

PS: I have enabled support access

PPS: There's a bug when attempting to save settings and the padding values for a service get changed. If anything else is changed in the Service settings tab, the padding value (after session value) does _NOT_ get set.

• Michelle Shull

Hello, Thomas!

Sorting all this out bent my noodle just a little. : )

Okay! I've peeked in at your settings, and you followed Tyler's advice to the letter, which leads me to believe that at this time, this particular set up, with Service A and Service B having similar start times, may be just a bit more than Appointments can handle out of the box.

I did see you have a second appointment booking plugin installed and active, has that been running alongside Appointments + the entire time? If so, try deactivating the other booking plugin and see if that resolves it. It's a long shot, but if the two plugins are using similar resources or naming conventions, it can confuse things a bit on the front end.

Hope your Sunday is going well, other than the Appointments issue. : )

• thomas_sjolshagen

Thanks for the feedback.

I can't disable the other appointment plugin since it's the one that is currently starting my sales funnel. That said, I'm not seeing anything in its code to suggest it would conflict.

I'd be willing (and am able) to modify the Appointments+ plugin if that's allowed. Or i can use filters to adjust the scheduling and output.

But... It looks like one of the major flaws of the Appointments+ plugin, from my perspective, is that there are no filters for the output or to generate arrays of schedule information. Would it be an idea to maybe add two filters letting advanced users/developers generate their own arrays of schedules and maybe a filter to display the schedule however we want?

``````function app_calculate_schedule( \$service, \$worker, ) {

...

// Return array of start/end, etc info.
return array(
array('start' => 'when', 'end' => 'when', ... ),
array('start' => 'when', 'end' => 'when', ... ),
...
)
}

A filter for displaying/outputting the schedule/calendar of times for the specific service in whatever format the admin/developer prefers is also really high on my requirements list.

Since I'm currently not seeing either of those filters in the plugin code, I think the plugin is too limited for me and I've thrown away some money, unfortunately.

If those two capabilities were ever added, I may consider coming back to Appointments+.

• Michelle Shull

Hi, Thomas.

We'd be sorry to lose you.

Many of our Members aren't comfortable editing or expanding plugins, so we try to keep our plugins as user-friendly as possible, especially for those who don't have a lot of tech experience. Sadly, sometimes that means sacrificing advanced tools for admins like yourself who both know what they're doing and enjoy the coding end of being a webmaster.

Thanks for being a great member, I'm sorry if Appointments hasn't met your needs.

• Tyler Postle

Hey Thomas,

Hope you're doing well today!

Can you give a link to the front end part of your appointments schedule so I can take a look there as well?

PPS: There's a bug when attempting to save settings and the padding values for a service get changed. If anything else is changed in the Service settings tab, the padding value (after session value) does _NOT_ get set.

I have confirmed this on my end as well and have marked it as a bug so the developer is notified :slight_smile: thanks for letting us know.

If those two capabilities were ever added, I may consider coming back to Appointments+.

I have also flagged this for our SLS(coding experts) so we can get their valuable feedback, whether or not this is something we can custom add for you.

Thanks for your patience Thomas! Have a great rest of your weekend.

Cheers,
Tyler

• Jose

Hey there @thomas_sjolshagen,

Your suggestion regarding the hooks would be definitely a great improvement for the plugin.
I'm usually in the need to provide custom tweaks and I wish to have those filters more often than you would think. :wink:

The team is aware of this, and the addition of useful hooks is one of the priorities in our roadmap.
In this particular case, a customization of the core wouldn't be easy, since the calendar markup and the data model are blended in the same routine.

That said, I would like to know a bit more about your requirement. I think we can make it work without code modification or, at least, using only the existing hooks.

ServiceA lasts 45-50 minutes and should start every 10 minutes (from 6am - 7am it should be possible to book a start at 6:00, 6:10, 6:20, 6:30, 6:40 and 6:50. I've got 1 service provider and 5 dummy service providers with work hours that start at 6:00, 6:10, 6:20, etc respectively) with the service capacity at 3 per service session.

I believe you are overlapping the service capacity with the dummy providers.
How many appointments would be possible to book in the same time slot? Only one? 3? or 5?

Cheers!
Jose

• thomas_sjolshagen

Hi Jose,

For Service A it should be possible for 3 people to book sessions for each of the start times (i.e. 3 people at 6:00, 3 at 6:10, 3 at 6:20 ,etc.)

The reason there are 5 dummies was to try and have the 6 start times per hour.

I noticed the blending of the controller (schedule logic) & the view when I was looking for filters I could possibly use.

• Jose

Hey Thomas,

In that case, I would suggest to take a different approach:

This will render the expected calendar. The only glitch would be that the appointments will show up in the confirmation form as 10 minutes duration.

Then, you can implement the following filter to show 1 hour duration in the confirmation form:

``````function get_actual_duration( \$text, \$duration ) {
//do stuff and return.
}

Please let me know if there is any remaining glitch and I'll be happy to look for a solution.

Cheers!
Jose

• thomas_sjolshagen

Thanks Jose.

Combined with multiple recurring appointments in gcal to block out the :45 - :00 timeslot for the appointments gave me the schedule I wanted for Service B. I haven't yet added the duration filter, but that's quick & easy, so until I'm done I'm not going to worry about it yet.

BUT, Service A still displays a 6:00, 6:15, 6:30, etc schedule whereas I'm looking for a 6:00, 6:10, 6:20, 6:30, 6:40, etc schedule.

I have 1 Service Provider and 2 dummy Service providers defined for Service A. The service is defined with a duration of 10 minutes (no padding) and the Service providers (including the dummy ones) are defined with a start time for their Working Hours at 6:00 am, 6:10 am and 6:20 am respectively.

The Time Settings are:

Base: 10 minutes

Time slot calculus method: Minimum based appointment duration calculus (legacy)
Boundaries detection: Exact period matching
Break times calculus: Invalidate enclosed offsets (legacy)

And the padding resolution type (which should be somewhat unnecessary for this service (Service A), is "Cumulative".

May be worth noting that the dummy providers are actually assigned to the primary service provider for Service B (this may be the reason for the issue?), but I don't see how to have multiple service providers with dummies.

• thomas_sjolshagen

That previous update was my bad. I'd added some math to the step filter () and as a result, it returned 1.5x 600 seconds (i.e. 15 minutes) for everything.

• Tyler Postle

Hey Thomas,