I was able to go into app + php and change the service time

I was able to go into app + php and change the service time duration to every 5 minutes, but it now when i selet at 35 min appointment it starts the time on the front end. E.g. it starts the appointment at 9:35 instend of starting at 9:30. How do i adjust the php so that it adds the 5 min to the end of the time slot?

  • Alexander
    • DEV MAN’s Mascot

    Hi @Mattbkelly,

    This could depend on how you've setup this modification. Could you post a summary of the changes you've made to appointments+ with any code examples?

    I recall we've worked on something similar before on this thread: https://premium.wpmudev.org/forums/topic/how-do-i-change-the-page-tittle-from-make-appointment

    Are you using the same code from there, or have you added or changed anything else?

    Best regards,

  • Mattbkelly
    • WordPress Warrior

    Yes, it was that tread.
    Here is what I changed:

    function get_min_time(){
    if ( isset( $this->options["min_time"] ) && $this->options["min_time"] && $this->options["min_time"]>apply_filters( 'app_safe_min_time', 9 ) )
    return (int)$this->options["min_time"];
    else
    return apply_filters( 'app_safe_time', 5 );
    }

    app_safe_time is the value you need to change

    Just changed the 10 in "return apply_filters( 'app_safe_time', 10" to a five.

    I don't know how to make the schedule start at 9:30 instead of 9:35?

  • pxwm
    • WP Core Meltdown

    Hi @Alexander Rohmann - Hope you don't mind me chiming in

    Hi @Mattbkelly

    I suspect the reason your 1st appointment is showing as 09.35 is because:-

    Your Service Duration is 35mins
    If you are using v1.3.1 and the default Time base settings then the Time Base is based on your Service Durations and it will calculate the 1st available time from midnight so:-

    00.00, 00.35, 01.10, 01.45, 02.20, 02.55, 03.30, 04.05, 04.40, 05.15, 05.50, 06.25, 07.00, 07.35, 08.10, 08.45, 09.20

    Therefore the 1st available time after 09h30 is 09h35.

    You may wish to try the following:-

    Login to your Wordpress dashboard as Admin
    Select A+ Settings
    Select the 'Add-ons' tab
    Activate the 'Durations' add-on
    Then Select the 'General' tab
    Scroll to the bottom of the 'Time Settings' section and you should be able to see a new field called 'Time slot calculus method'
    Set this to 'Minimum time based appointment duration calculus (legacy)'
    Then save
    Then try to see if it lets you book a Service at 09:30
    If it does it will also allow you to book the Services at 09:30, 09:35, 09:40 etc

    Hope this helps
    Regards
    SteveB

  • Alexander
    • DEV MAN’s Mascot

    Thanks @pxwm for the time settings walkthrough!

    Hi @Mattbkelly,

    Regarding the code change: So you changed the actual appointments+ file? You shouldn't need to do this at all, in fact, any changes made would be deleted if you update the plugin. That's why I gave the code using the filter in the other thread. That code could be added as it's own plugin, or in a theme's functions.php

    I see we lost the other zip file, so I'm uploading another copy here.

    Please revert any changes you made from before to the core Appointments+ files and use this instead.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.