The availability of one of the service providers doesn't display properly

If the service provider's working hours are set 9:00 AM to 5:00 PM, it allows booking of the service. But if you set to 10:00 AM to 5:00 PM, all time slots won't be available. Service duration is 420 minutes, so 10 AM to 5 PM should be enough for providing service.
For another provider on the same site, it is working fine.

  • Predrag Dubajic

    Hey bala,

    Hope you're well :slight_smile:

    I was doing some testing based on your installation and it looks like we have an issue with weekly calendar shortcode.

    If you check the appointments page when you change the time for Friday to start from 10AM you will see that the time slots are still the same and they all start from 9AM, so Friday's 10AM slot is not shown and that's why you can't book it.

    If you check your make-an-appointment page which uses monthly calendar you will see that the time for Friday will be available as it will open the 10AM slot.

    I have created a bug report and forwarded it to our developers and the only working setup I found at this moment is to set each day to start from 10AM as this will update the weekly calendar shortcode with new times and when they all start from 10AM they will show as available.

    Thank you for bringing this up to our attention!

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Bala,

    Sorry if I was unclear in my previous response, let me try explaining it a bit better :slight_smile:

    I'm aware that you are using /desc_sec/ page and not /make-an-appointment/, however the desc_sec page uses Weekly calendar that has an issue with time slots if days of the week have different start and end work times for your provider and I have already reported that to our developers.

    1: secretaire dentaires hours are 9 to 5pm but the calendar shows 9 to 4pm there is an hour interval.

    Time slots are showing appointment duration, not working times.
    So, your working times are set to 9 to 5 but the service duration is 7 hours so it ends at 4 and that's what's shown as service duration.

    2 service dhygienist(abou) hours are 8 to 4pm but shows 9 to 5 pm.

    I'm not sure that I understand this issue however, your desc_sec page is showing 8:00 am - 4:00 pm for Service d'Hygiéniste for me:

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Bala,

    About this issue:

    the issue now is only with the first one service de secretariat, the work hours are from 9 to 5 while it shows only 9 to 4.

    As I mentioned above the calendar is showing Service time, not working hours.
    Your service time is 420 minutes, or 7 hours, which is from 9 to 4.

    Bu the issue remain as soon as you have different start time as you mentionned some days becoem unavailable. when do you think your developper will fix it as I have to check with a client.

    Our developers are already looking into this and we're hoping to see a patch soon but I can't still give any ETA.

    Best regards,
    Predrag

  • Panos

    Hi there bala !

    Thanks for spotting and reporting this :slight_smile:

    However I'm not sure if this is a bug. I will have to consult with main dev, but it's definitely going to be changed so it works better in these cases.

    In the meanwhile I have prepared a snippet which you can paste in your functions.php or you can download file and upload it to your wp-content/mu-plugins folder (if that folder doesn't exist you can simply create it).

    You can find the snippet here:
    https://gist.github.com/wpmudev-sls/5bbed2489795b806b1048827a5504599

    Please let us know if this helps :slight_smile:

    Thanks!

  • bala

    I have tested the code as mu-plugin but the issue remains. the duration is taking over the working hours. Also when you change the start date for another day that whole week will start from that starting hour.. Also if you change the date from 10am the whole week become unavailbale.
    so I have Monday, Friday and Saturday to start from 10 am they become unavailable.
    I have tuesday, wenesday and thursday from 8 to 4 but shows from 8 to 3 so taking duration in account not working hours. I appreciate the time you taking to work on this.

  • Panos

    Hi bala ,

    I'm not sure if I understand the issues you describe, I did see some issues hopefully they are the same :slight_smile:

    I have updated the snippet so you can re-download it and replace your previous one. Here is the link again: https://gist.github.com/wpmudev-sls/5bbed2489795b806b1048827a5504599

    I'll give you an example of how it should work:

    1. In admin > Appointments > Settings > General tab in the Time base option I have set 30 minutes. So in the weekly calendar it should set available hours each 30 minutes since the earliest start hour.

    2. Service duration is 420 minutes (7 hours)

    3. In the provider's working hours I have the following variety of hours:

    4. And I get the following calendar:

    Could you please let me know if you find anything wrong in the logic or if it doesn't work in your installation as above?

    PS.
    I have deleted the comment you have added in the gist page, because there was no explanation for the code pasted there.

    Cheers!

  • Predrag Dubajic

    Hi Bala,

    thank you. in this logic it means that whatever the service provider set in the calendar has his working hours doesn't matter because what is taking in account is the service duration not the working hours.

    Appointment calendars, both weekly and monthly, are not showing working times, they show available slots so working hours will affect number of those that are shown.

    If im available to work from 8-4 but if the service duration is only 5 hours the calendar will only show 5 hours.

    This should be fixed with Panos above plugin, you can also download that file, put it in your wp-content/plugins/ and activate it as any regular plugin in order to work.
    This is a difference on my installation before and after Panos' plugin was activated:

    Best regards,
    Predrag

  • bala

    I have dowlloaded the file to my plugin directory and activated as a plugin.
    I unerstood that working hours are taking effect and available time slot
    1. the monthly calendar seems to work but jumping from September - November - December going by 2 months not one month when you click on next month. here is the link http://senejob.net/cal/
    2. the issue I have is i the service hours set to 7 hours and the user set his calendar to work for 6 hours it won't work. maybe that's the logic of the calendar.
    My issue is that the users have to setup their own hours if they set their hours less than the work duration the calendar won't work. Is there a way to give access to the user the services tab so they can setup the duration of work.

  • Predrag Dubajic

    Hi Bala,

    So are all the times shown properly now?

    1. the monthly calendar seems to work but jumping from September - November - December going by 2 months not one month when you click on next month. here is the link http://senejob.net/cal/

    I had a look at your page setup and it's because of this shortcode:
    [app_pagination step="2" month="1"]
    Problem is the step="2" part you have in there, this defines that pagination should go two months in advance and it should be used when you have two months shown per page, in cases where you have only one month, like yours, this is not needed so I removed it and it's working properly now.

    2. the issue I have is i the service hours set to 7 hours and the user set his calendar to work for 6 hours it won't work. maybe that's the logic of the calendar.
    My issue is that the users have to setup their own hours if they set their hours less than the work duration the calendar won't work. Is there a way to give access to the user the services tab so they can setup the duration of work.

    Plugin calculates working hours and fits the available appointments in that time, if the service is longer than the working hours it will be shown as unavailable.
    Best thing would be to tell your providers to match their working hours for service duration, but you can also go to Appointments > Settings > General > Advanced and enable "Allow Overwork (end of day)" option.

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Bala,

    I'm afraid that something like this will not be possible without some extensive custom coding.

    Having the duration settings on front end is not the only issue, one more thing that you should note is that one service can't have multiple duration times, so even you get service duration setting on the frontend then when provider changes service duration that will affect the duration for all providers.

    So you will need to have separate service for each provider so they can can different durations.

    Best regards,
    Predrag

  • Adam Czajczyk

    Hello bala!

    So even in the back end I have to create different service for each provider?

    If you go to the "Appointments -> Settings -> General -> Accessibility" page and enable the "Allow service provider set working hours" option (set it to "Yes"), your service providers will be able to set their own working hours in back-end on their profile pages or - if you are using BuddyPress - in their BuddyPress.

    However, that doesn't let them change services/services' duration. If the "same" service has to be available with different duration depending on a service provider, then yes - you would have to create services for each provider, assign that service to that provider only and set its duration accordingly.

    Kind regards,
    Adam