appointments + plugin working hours schedule

Hi,

I want to know if I can amend the code for the working hours file, I wish to add four weeks, so my client can enter the specific times for each week. I know this can't be done in the admin area but which file do I edit to amend the php code so that instead of break I would have the week one displayed and a calendar to pick the week.

If this isn't possible then would it be possible to add a time (start and end times of shifts) as well as the date for the exception field for additional working days? Again I know this isn't possible in the admin area but which file would I have to amend to add this field ?

I'm guessing more then one file will need to be changed for either of these options because the database will need updating as well and an extra column added for any of the tables that are amended.

This is the only solution I can think of to continue using this plug in for this site.

Kind Regards
Shabnum Rinth

  • Elliott Bristow
    • The Bug Hunter

    Hi Shabnum,

    Welcome to the WPMU DEV Forums!

    This is quite a tricky question to answer. What you are proposing would be a pretty fundamental change to the plugin, and the code would spider into many of the plugin files.

    Firstly, you need to edit the back-end admin pages, then add a whole collection of extra database fields and settings to store the extra information. Then you would need to edit all the front end code that loads and displays calendars. You would also need to change the code that handles Service Provider availability, since they have their own calendars separate to the base calendar...

    In short.... this is not an easy "tweak". My recommendation in this case would be to post this as a job on our Job Board and see what the developers there suggest for this kind of project. You can access the job board at https://premium.wpmudev.org/wpmu-jobs

    If anyone else in the community has a different suggestion I'm sure they will add their comments.

  • rinths
    • Flash Drive

    Hi,

    I thought that might be the case and I am not a php developer!

    I will post it to on the job board, but the other solution would be to add time for the exception field, I have read a couple of people asking for this, is there an easier way to do this because that would resolve my issue without having to amend a lot of code.

  • Hakan
    • The Incredible Smush

    Hi,

    Can't you do like this?

    1) Define 4 different service providers
    2) Set their daily working hours as required
    3) Using app_is_holiday filter, close all days except the first week for provider one, except second week for provider 2, so on...

    Then you will have different working hours for 4 weeks and the rest of the dates will be all closed.

    But if this doesn't work for you, and if you are asking which file to modify, there is only one file: appointments.php

    I hope this helps.

    Cheers,
    Hakan

  • rinths
    • Flash Drive

    Hi Hakan,

    Thank you for your suggestion, I think it might help resolve my issue.

    So far I have managed to do this....

    1) have added 4 service providers
    2) set their daily working schedule

    but I'm not sure what you mean by
    3) Using app_is_holiday filter? Is this a file that I need to amend in the plug in directory?

    I couldn't find this file in the core directory files so not sure where I go for this bit can you please explain in detail..thank you once again.

  • Hakan
    • The Incredible Smush

    Using app_is_holiday filter? Is this a file that I need to amend in the plug in directory?

    That is a filter hook. In WordPress plugins files are not modified but you use filter or action hooks for that.

    This is a good starting point to understand what hooks are:
    http://wpcandy.com/teaches/how-to-use-wordpress-hooks/#.UVrAhZNkOtM

    A+ is normally designed for ongoing businesses. But you want to limit it to only 4 weeks. So you should define all other days as holidays. Obviously this will be difficult using exceptions. Then you should do it as a whole, using app_is_holiday filter hook.

    Here is an example of using app_is_holiday filter:
    https://premium.wpmudev.org/forums/topic/seasonal-business-removing-calendar-months-from-plugin#post-335836

    You should modify it for your specific weeks.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.