How can I add a longer appointment duration in Appointments?

I'm trying to set up my Appointments+ plugin, but I can't get it to allow an 8-hr (480 minutes) appointment. I put 480 in the "Additional time base" box, but when I try to add a 480 minute service, the highest number available is 360.

Can someone help, please?

  • Patrick

    Hi there @Carole

    Welcome to WPMU DEV, glad to have you aboard!

    By default, the maximum duration that will appear for selection will be equal to 24 times your Time-Base (which you have set at 15 minutes).

    You have 2 options to fix that:

    - You could either set the Time-Base to something like 30 minutes, which would allow you to select your required duration.

    - Or you could add the following function to your active theme's functions.php file to override & customize the default limit:

    function increase_service_selections( $n ){
        return 48;
    }
    add_filter( 'app_selectable_durations', 'increase_service_selections' );

    The above code snippet will make it so that the available durations will be up to 48 times your Time-Base.

    Please note however that the maximum allowed duration is 1440 minutes (24 hours) regardless of any customizations like above.

    Please do let us know if this helps, and don't hesitate to post again if you need more help with this.

  • Carole

    Okay, apparently it DOES matter where it goes, because I added the code as the last line of functions.php and it broke my site. When I tried to refresh the page, all I got was this:

    Fatal error: Call to undefined function add_filter() in /home/hayesproject/public_html/spellboundboudoir.com/wp-includes/functions.php on line 4853

    so I deleted it again, and now I'm waiting to find out exactly where I need to put it....

  • Sajid

    Hi @Carole

    Hope you are doing good today :slight_smile:

    As stated by Patrick there are two options to increase the duration. One is change it with PHP code (that did not worked for you). The other is changing the Time-base value.

    To change the Time-base go to Appointments > Settings > General > Time Settings > Time base (minutes) and change it from 15 to 30 (screenshot.)

    Now got Appointments > Settings > Services and select the duration (screenshot).

    Take care and have a nice day :slight_smile:

    cheers, Sajid

  • Carole

    I can't change the time base value, because I have it set for what I need it to be. (I have it set for fifteen minutes; I could change it to five, but that will make things worse, not better, as far as being able to offer an eight hour session.) If I change it, I'll have to change the lengths of some of my sessions to fit, and I don't want to do that.

    I'm confused.... If somebody will tell me where exactly to insert the code, I can put it there. If I already put it in the right place and it broke my site, then how is what I was given the right code??

  • Sajid

    Hi @Carole

    Hope you are doing good today :slight_smile:

    The given code is right. I tested it on my sandbox site and its working how it suppose to work.

    I think you did not added in the right place. If you post your functions.php file code here so I can see where you added and fix it accordingly. You can also attach this file as .zip.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Carole

    "I think you did not added in the right place. If you post your functions.php file code here so I can see where you added and fix it accordingly. "

    This is why I asked for someone to tell me where, exactly, it needs to go. I'm not a developer, and I don't know my way around in php. I managed to find the functions.php file, but it has over 4000 lines of code, and I don't know WHERE in there it's supposed to go. Putting it at the end broke my site, so obviously it doesn't go at the end, but I really don't want to have to try it in a thousand places to find the right spot.

    "You can also attach this file as .zip."

    What file, and attach it where??

  • Sajid

    Hi @Carole

    Hope you are doing good today :slight_smile:

    I am sorry for confusion.

    What file, and attach it where??

    You can find functions.php file of your theme located in wp-content/themes/YOUR_ACTIVE_THEME via FTP or file manager using cPanel.

    If you are still not sure where is it then send in your WordPress login and FTP details in following format and I will update the code myself for you.

    Subject: "Attn: Sajid Javed"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me :slight_smile:

    https://premium.wpmudev.org/contact/

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Sajid

    Hi @Carole

    Hope you are doing good today :slight_smile:

    Yes try it once and let us know the results.

    If its still not working then send me FTP details so I can make these changes myself and further investigate this issue. Again here is the format that I need you send the details in.

    Subject: "Attn: Sajid Javed"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me :slight_smile:

    https://premium.wpmudev.org/contact/

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.