Couple of Appointments+ Bugs

Hi I have a couple of bugs. I'm on version 1.9 but can confirm it still does it on version 1.91

1) This is only recent and never used to happen
In the back end. When I click on an appointment and try and edit it. Everything works fine until I'm finished and I try and click and edit the appointment below. The top appointment now dissapears! It re-appears when I refresh the page

2) Google Calendar Sync. If I change the Service Provided it doesn't update in my calendar. Time does but not Service name or price. Pretty sure this used to work too.

Possible some of the code I'm running is interferring appreciate any help

Kind Regards
Kieran

    Adam Czajczyk

    Hello Kieran,

    I hope you're well today and thank you for your question!

    1) This is only recent and never used to happen
    In the back end. When I click on an appointment and try and edit it. Everything works fine until I'm finished and I try and click and edit the appointment below. The top appointment now dissapears! It re-appears when I refresh the page

    I tried to replicate this on my end with the newest Appointments+ release but so far I wasn't able to. Are there any specific steps (edits) that I should try? Have you also eliminated possible caching issues already? Let me know please so I could give it another try following the same steps you did.

    2) Google Calendar Sync. If I change the Service Provided it doesn't update in my calendar. Time does but not Service name or price. Pretty sure this used to work too.

    I'm not sure what do you mean by "change Service Provider". Is it that you edit a booked appointment and change assigned service provider or that you change service provider assigned to the service on settings page? I understand that you're referring to the main GCal sync and not the individual service providers' integrations, is that right?

    Please advise!
    Best regards,
    Adam

    Kieran

    Hi Adam

    1) no caching is run on the site. I just click on the edit details bit of the appointment. Then click and try and edit the one below and the top one disappears!

    Support access is granted to see if you can see the bug in my site.

    2) service provided not server provider.

    Say I change the service booked from a "sports massage" to "reflexology" and the name of the service and price doesn't update in Google calendar like it used too!

    Cheers
    Kieran

    Predrag Dubajic

    Hi Kieran,

    Bit of update here, the issue with appointments disappearing will be worked on for the next release

    The gcal thing is actually meant to work this way because many users actually update info in gcal directly so we're not overwriting that.
    You can change it by adding this code snippet in your child theme fuctions.php or as mu-plugin:

    add_filter( 'appointments_gcal_update_event', 'app_gcal_update_event_summary', 10, 2 );
    function app_gcal_update_event_summary ( $event, $app ) {
    	if ( $event ) {
    		$appointments = appointments();
    		$event->setSummary( $appointments->get_service_name( $app->service ) . ' Appointment' );
    	}
    	return $event;
    }

    Best regards,
    Predrag

    Kieran

    Hi Predrag

    Is this a recent update because I'm sure it never use to do this?

    I've implemented the code but it's not working. it freezes when I try to add an appointment and i can also see the code at the top of the page in the dashboard

    Can I ask will this also update my
    Client Name (CLIENT)
    Client Phone (PHONE)
    Service Name (SERVICE)
    Price (PRICE)
    Server Provider Name (SERVICE_PROVIDER)

    I'd just like it to take what ever is in Appointments + I dont want it to consider changes in my googlecalendar

    I have my google calendar setting as A+ -> GCal. If I wanted to bring in Goolge calendar changes then I'd set it to synchronizations mode?

    Can you please rethink about this recent change and maybe bring back the original settings unless synchronization mode is activated? Or maybe another mode we could create?

    Thanks for the help so far

    Kind Regards
    Kieran

    Predrag Dubajic

    Hi Kieran,

    I just double check the code on my installation and had no issues with updating the status on Gcal with it, can you try adding the code as mu-plugin and see if works after that.
    You can do that by downloading attached file, place it inside your wp-content/mu-plugins/ folder.

    If you don't have mu-plugins folder simply create one yourself.

    Let us know if it works after that.

    Can you please rethink about this recent change and maybe bring back the original settings unless synchronization mode is activated? Or maybe another mode we could create?

    I'll run this by the developers so they can double check this behaviour.

    Best regards,
    Predrag

    Kieran

    Hi Predrag,

    Many Thanks. I've implemented this as an MU Plugin and can confirm it updates the service name and time. But as mentioned above I need it to update all of the below. Basically how it used to work

    Client Name (CLIENT)
    Client Phone (PHONE)
    Service Name (SERVICE)
    Price (PRICE)
    Server Provider Name (SERVICE_PROVIDER)

    It doesn't update Client Name / Phone / Price or Service Provicer name at the minute

    Thanks for the help so far

    Kind Regards
    Kieran

    Predrag Dubajic

    Hi Kieran,

    Can you try replacing current code from above attached mu-plugin with this one and see if it works after that:

    <?php
    add_filter( 'appointments_gcal_update_event', 'app_gcal_update_event_summary', 10, 2 );
    function app_gcal_update_event_summary ( $event, $app ) {
    	if ( $event ) {
    		$appointments = appointments();
    		$event->setSummary( $appointments->get_service_name( $app->service ) . ' Appointment' );
    		$event->setSummary( $appointments->get_client_name( $app->service ) . ' Appointment' );
    		$event->setSummary( $appointments->get_price( $app->service ) . ' Appointment' );
    		$event->setSummary( $appointments->get_worker_name( $app->service ) . ' Appointment' );
    	}
    
    	return $event;
    }

    Best regards,
    Predrag

    Kieran

    Hi Predrag

    Unfortunately it's not working as expected. Instead of the service name it now just says "Our Staff Appointment" instead. The Time works but nothing else does. Infact the old code worked better as Service Name isn't updating.

    I think in order to future proof this I'd like it to just pull through all available possible fields? I think the extra ones are

    CLIENT_PHONE
    CLIENT_ADDRESS
    CLIENT_CITY
    LOCATION
    NOTES

    In addition too

    Client Name (CLIENT)
    Service Name (SERVICE)
    Price (PRICE)
    Server Provider Name (SERVICE_PROVIDER)

    Basically any Shortcode link that is possible to send to Google Calendar.

    Many Thanks
    Kieran

    Adam Czajczyk

    Hello Kieran!

    My colleague Predrag just provided me with a new version of the plugin he shared with you previously. It's been consulted with one of the developers and it does seem to be working on my end. Please replace the current code inside the mu plugin file with this one and give it another try:

    <?php
    add_filter( 'appointments_gcal_update_event', 'app_gcal_update_event_summary', 10, 2 );
    function app_gcal_update_event_summary ( $event, $app ) {
        if ( $event ) {
            $appointments = appointments();
              $event->setSummary(
                $appointments->get_service_name( $app->service ) . "\n" .
                $appointments->get_client_name( $app->service ) . "\n" .
                $appointments->get_price( $app->service ) . "\n" .
                $appointments->get_worker_name( $app->service )
            );
        }
    
        return $event;
    }

    Best regards,
    Adam

    Kieran

    Hi Adam,

    I've tried the same code again above but I'm afraid the results are no better in fact they are worse.

    First when I make an appointment it makes 2 appointments in my calendar and they still show when I move the appointments to remove

    None of the fields update when I change the fields although when I change the time 1 of the duplicate appointments now dissapears but the time and all the other details are still wrong.

    I've removed the MU plugin. maybe something is conflicting on my site if its working on your test site

    Support is open for my Treat Me At Home test site

    Kind Regards
    Kieran

    Kieran

    Hi,

    I've disabled my theme and only enabled the basic plugins. I also removed all MU Plugins and added the above code again

    I can confirm the following updates correctly

    TIME
    SERVICE NAME (In my calendar header but not in the notes section)

    When I changed the Service Provider the appointment dissapeared from my calender completly! However when I changed the Service Provider back to the original one the notes section did update correctly! So then CLIENT NAME, PHONE, ADDRESS ETC all updated but only after changing the Service Provider name.

    Weirdly it only did this when I picked a particular service provider. Picking another one made no difference and nothing updated

    Support is open

    Kind Regards
    Kieran

    Panos

    Hi Kieran ,

    In order to make some tests on gCal it would be helpful if I could use a testing calendar of mine, so I can see what happens there. Would that be ok with you? It's possible that it may add some events on your site, so you can keep a db backup and when you restore all my events get removed from your site.

    Please let me know if you are ok with this and also confirm that the site I will be testing is Treat Me At Home and it's not a live site, it's a test site

    Thanks!
    Panos

    Panos

    Hi Kieran ,

    Sorry that I wasn't clear

    I already have access for Treat Me at Home but it becomes unresponsive some times. This makes debugging hard as I can't monitor any changes I do, and it takes allot of time to reload.

    So, it would make things much much easier if I had access to a more responsive but similar site. It would be great if you could provide ftp access to some other site, I think it would help

    Thanks!
    Panos

    Adam Czajczyk

    Hello Kieran!

    Is there any update on the google calendar sync issue yet?

    You are referring to the "service provider change not overriding the GCal" notes? That is not considered a bug. It's a design decision: as many users are actually using that notes to add their own information outside of the Appointments+ the plugin will not be overwriting them.

    If I misinterpreted your question, let me know please.

    As for the "appointments on the list" issue. I can see that it's marked for a fix to be included in update though I'm not able to give you any ETA on that update.

    Kind regards,
    Adam

    Kieran

    Hi Adam

    It's more when I change the actual service name in Appointments+ it doesn't update to my calendar? When the client changes what appointment they want. Surely that can't be correct it doesnt flow through? I'm not sure what you mean by the notes section. Things like service name and service price should update if I change them in the plugin should they not?

    Especially when I have the setting as A+ -> GCal (Only export Appointments)

    I can understand if I had that set to A+ <> GCal (Synchronization)

    That would make it more difficult to decide what information to overwrite. But in that case it should update both the notes section in Google and Appointments+ no matter which one you changes it in? To keep the two in sync?

    Is there a guide anywhere I can read which means explains how I can integrate the two better? I'd like to be able to add appointments in Google Calendar but not sure how to do this so it adds it into Appointments+ and create an email etc.

    Kind Regards
    Kieran

    Adam Czajczyk

    Hello Kieran!

    It's more when I change the actual service name in Appointments+ it doesn't update to my calendar? When the client changes what appointment they want. Surely that can't be correct it doesnt flow through? I'm not sure what you mean by the notes section. Things like service name and service price should update if I change them in the plugin should they not?

    This information: service name, service price - and any other that is not a service date and title - are stored in GCal "description" field (a.k.a "notes"). This is the only field where it can be added at all. That's what we do not update because we would this way overwrite any other information that GCal user could put there manually. That's why this is not planned to be changed. That's kind of GCal limitation rather than plugin.

    The workarounds would be the codes that we already shared with you previously.

    Is there a guide anywhere I can read which means explains how I can integrate the two better? I'd like to be able to add appointments in Google Calendar but not sure how to do this so it adds it into Appointments+ and create an email etc.

    Since you already have integration enabled the only thing you would want to change would be to make sure that it's set to "A+ <-> GCal" and then appointments created directly in Google Calendar would also be added to the Appointments+.

    Kind regards,
    Adam

    Kieran

    Hi Adam

    I'll try and locate my old thread but the codes you guys suggested wasnt working for me if I remember correctly I definitly want it to just take whats in Appointments+ rather than GCal though. Is there a way we can have an additional setting so it works for people like me and others?

    I mean how do I create an appointment in Google Calendar where it would know what service provider I was chossing and what prices I have. Is there a simple user guide please?

    Thanks
    Kieran

    Adam Czajczyk

    Hello Kieran!

    I'm not quite sure what to say but it seems that I got that much focused on what we discussed here and what was marked as "not a bug" in our internal reporting system that I completely forgot that since this thread had started had "paused" the plugin has been updated! I'm really sorry about that, I should have remember!

    Here's the thing: the 1.9.4 version does include what we were talking here about. There's a whole new section of Google Calendar integration settings and the most important parts are this:

    There's a new setting "Overwrite Google Calendar Title and Description" that you can enable (it's "off" by default). When it's "on" any update to the appointment on Appointments+ side, such as e.g. changing service or service provider - when adding/editing appointment, will be reflected in an existing Google Calendar event.

    Below there's also a field where you can define (using outlined placeholders) what data should be added to Google Calendar even, for example: service name, service provider, price etc.

    I hope that's a good news.

    I mean how do I create an appointment in Google Calendar where it would know what service provider I was chossing and what prices I have. Is there a simple user guide please?

    This is a bit different. If there's only a single calendar ("general one" integrated it will set provider as "Our Staff" and select the default service. Since these appointments are always put to "Reserverd by GCal" tab on "Appointments" page it's easy to edit them.

    If you let service providers integrate their own calendars the service provider should be set according to the calendar that the event is coming from.

    Please note though that the Google Calendar integration is still considered a "beta" feature and it wasn't intended to be used (even though it's capable to do this) as a main tool for managing Appointments. It is rather a way to keep track via Google Calendar (that most of us have access to pretty much constantly) appointments that were made on the site by customers and/or to just "block" spots that for some reason shouldn't be necessary (an example case: I got stuck in a traffic jam and I can't get on time so I block the spot so no customer can book it).

    Best regards,
    Adam