Appointments+ GCal not Removing Cancelled Appointments or Updating existing ones

So in the GCal Sync it appears as cancelled appointments aren't being cancelled in GCal and appointments that are modified aren't being updated in GCal. I'm also having issues with the name not transferring over to the Client field in the GCal description. I'm trying to rewrite the script to show their Wordpress display name rather than their Appointments+ name.

  • Ash

    Hello @Chris

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    Please note that, the changes in GCal won't reflect in real time, it will need some time and also you will need some visitor in front end. How long did you wait after canceling the appointment?

    I'm trying to rewrite the script to show their Wordpress display name rather than their Appointments+ name.

    Would you please let us know how you are rewriting the script? I will include a developer if needed.

    Cheers
    Ash

  • pxwm

    Hi @Chris

    Just out of interest could you please confirm what is the status of the appointment when you are trying to cancel or modify?

    I ask because if the appointment is still in a status 'Reserved by GCAL' then making changes or cancelling the appointment in A+ will not invoke a change in your Google calendar.
    In the 'Reserved by GCAL' status you have to make the change/cancel in your Google calendar which should then be synchronised with A+.

    However if you confirm the appointment first then any changes in A+ should synchronise with your Google calendar.

    Also could you please confirm if your Goolge account is a personal or business account?

    Regards
    SteveB

  • Jose

    Hi @Chris,

    In order to alter change the description for the Gcal event object, you can hook in the 'app-gcal-set_description' filter.

    I made this snippet for you. You can place it in your functions.php or wrap it as a mu-plugin.

    add_filter( 'app-gcal-set_description', 'filter_gcal_description', 10, 2);
    
     public function filter_gcal_description($description, $app) {
            $macro = 'WP_DISPLAY_NAME';
            $replacement = 'No Defined';
            if($app->user && ((int)$app->user > 0)){
                $user_info = get_userdata( $app->user );
                if($user_info){
                    $replacement = $user_info->display_name;
                }
            } else {
                $replacement = $app->name;
            }
     $description = preg_replace('/' . preg_quote($macro, '/') . '/U', replacement,  $description);
            return $description;
    }

    Of course, you will need to change the description macro in your settings, as showed in the attached image, to match the new custom macro 'WP_DISPLAY_NAME'.

    Hope this helps. Please let me know if you need further details or have any other question.

    Cheers!
    JJ

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.