View My Appointments Link & Appointment Limit?

1) Is there a way that I can create a page specifically for my clients to view their scheduled appointments?

I created the page here, but how can I implement the "click here to login" link? Can I do this without posting the booking calendar on this page?

http://client.meetgeraldine.com/oxsalon_v1/my-appointments

2) Is there a way that I can setup a limit on the number of appointments a person can make per month? I would like to set it so they can make no more than 12 appointments in one month.

  • aecnu

    Greetings geraldine_convento,

    Thank you for the questions.

    2) Is there a way that I can setup a limit on the number of appointments a person can make per month?

    Not that I am aware of but it would make a great feature request which should be handled in a ticket of its own.

    1) Is there a way that I can create a page specifically for my clients to view their scheduled appointments?

    Why certainly you can, please see shortcodes, specifically [app_my_appointments], by being logged into the admin dashboard and going to --> Appointments --> Settings --> Short codes tab and you will see the available parameters for the short code.

    I created the page here, but how can I implement the "click here to login" link?

    I created the page here what page have you created and where?

    how can I implement the "click here to login" link?

    Just like any other link - I do not know what I am missing here but this is a simple item to prepare unless I am indeed missing something?

    Please advise.

    Cheers, Joe

  • Hakan

    Hi,

    For the second question, here is a tested and working sample which limits number of appointments those are pending, confirmed or paid at any time per logged in client:

    // Works only if login required
    function limit_active_apps( $reply_array ) {
    global $wpdb, $current_user, $appointments;
    // Change statuses as required. i.e. remove pending condition if you wish
    $count = $wpdb->get_var( "SELECT COUNT(*) FROM " . $appointments->app_table . " WHERE user=".$current_user->ID." AND (status='pending' OR status='confirmed' OR status='paid' ) " );
    if ( $count >= 12)
    return array( 'error'=>'You have reached maximum allowed number of appointments' );
    return $reply_array;
    }
    add_filter( 'app_pre_confirmation_reply', 'limit_active_apps' );

    Add these codes in functions.php of your current theme.

    Obviously you can modify the mySQL clause to check for any appointment for the last 30 days, or for current month, or any other condition.

    Cheers,
    Hakan

  • Alexander

    @aimkbe,

    Would you mind opening up a new thread for this? That way we don't miss anything, and can be courteous to the users above. This way they won't be receiving post notifications from our conversation - long after the topic was originally raised.

    It's also easier for us to keep track of newer threads.

    You can start a new topic here: https://premium.wpmudev.org/forums/#question

    Appointments+ has changed quite a bit, so it's possible that code won't work any more with the more recent versions.

    Thanks.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.