Time base (minutes)

Not sure exactly how to configure the base time, I provide 4 options to my clients for appointments: 90 minute,
180 minute, 300 minute and 480 minute packages.
What should I use as my base time?

  • Hakan
    • The Incredible Smush

    Hi,

    All service durations should be divisible by the time base. In your case you can only do this with 30 minutes set as time base.

    Also you need to add this code inside functions.php of your current theme to let more service duration selection options to be visible (16 x 30 = 480):

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

    Cheers,
    Hakan

  • joe
    • New Recruit

    I added the code to functions.php and now I have 4 options to choose from in the dropdown, but they are not my times:

    ie:
    30, 60, 90, 120, 150

    If I change base time to 90, I get closer:

    90, 180, 360, 450

    I need
    90, 180, 300, 480

    Also, if I use 90 as base, and then test the system to try and make a booking, if I select option with 450 minutes, the calendar show no time slots available. My hours are 6am to 10:30pm. What gives?

    Also, what if I want my clients to see "hours" instead of minutes?

  • Hakan
    • The Incredible Smush

    Hi,

    You should be seeing 16 service duration selections. Please see attached screenshot.

    Are you sure that you added codes to the correct functions.php? It should be the current theme's file.

    Also, what if I want my clients to see "hours" instead of minutes?

    You can use 'app_confirmation_lasts' filter hook to convert minutes to hours. Like this:

    function convert_to_hour( $text, $duration ) {
    if ( $duration < 60 ) return $text;
    $hours = floor($duration/60);
    if ( $hours > 1 ) $hour_text = ' hours ';
    else $hour_text = ' hour ';
    $mins = $duration - $hours *60;
    if ( $mins ) $min_text = $mins . ' minutes';
    else $min_text = '';
    return $hours . $hour_text . $min_text;
    }
    add_filter('app_confirmation_lasts', 'convert_to_hour', 10, 2);

    Cheers,
    Hakan

  • joe
    • New Recruit

    Wow, I do not see 16 options, only 4. And yes, I added to functions.php of the current theme. I will inspect the code to be sure I do not have typo.

    Thanks for the additional support, I will try this and get back to you.

  • Hakan
    • The Incredible Smush

    Hi,

    Where to I insert the 'app_confirmation_lasts' filter hook to convert minutes to hours? is this also in functions.php of active theme?

    Exactly.

    FYI, functions.php file of your current theme is like a plugin which is automatically activated with the theme.

    Cheers,
    Hakan

  • joe
    • New Recruit

    Ok thanks Hakan! It is working now.

    I am having other issues, but must I first open new thread?

    1) Booking process uses pop-up, which is blocked, is there a way to not use pop-up?
    2) Notification emails come from site admin email address (Dashboard >> Settings > General ) is there a way to change the from name and mailto of the notifications?

    Thanks :slight_smile:

  • Hakan
    • The Incredible Smush

    Hi,

    Booking process uses pop-up, which is blocked, is there a way to not use pop-up?

    We don't use pop-up. Can you elaborate?

    is there a way to change the from name and mailto of the notifications?

    You can modify email header as you wish:

    function modify_message_headers( $h ){
    return "MIME-Version: 1.0\n" . "From: Whatever You Want <Whatever_email>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    }
    add_filter( 'app_message_headers', 'modify_message_headers');

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.