Double bookings in appointments+, using google api?

About once a week we get a double booking - the first one is made directly to gcal (api sync) atleast a few days before, and then someone makes a reservation through website to a overlapping time spot (it was available even though there was google calendar event!). I checked that all the other events in gcal have also been reserved in appointments plugin correctly (I'm not sure about these double-book ones, as it doesn't show past gcal reservations). There was no difference how these reservation were made. Can you help me? We cannot continue using this plugin if double bookings continue to occur.

  • Ash

    Hello @Tomi

    I hope you are well today.

    I made a new google account for the purpose that has 2 provider specific calendars that i shared

    So, you mean the same calendar is shared with two providers? In that case, booking from gCal doesn't block the slot in Appointments+. You can enable gcal integration for service providers from Appointments > Settings > Google Calendar. Then they can integrate their own calendar and only then booking from gcal will block the corresponding slot.

    If you want to take control of their gcal, in that case, after enabling provider integration, you can create two separate calendar in gCal and integrate with them. That should work too.

    Cheers
    Ash

    • Tomi

      If you want to take control of their gcal, in that case, after enabling provider integration, you can create two separate calendar in gCal and integrate with them. That should work too.

      That is exactly what I did, and tried to explain. Everything else works as supposed, but about once a week a time slot is available where it shouldn't be. Other slots/events do get synced to A+. And like I said, it can occur many days after adding the "event" to a google calendar.

  • Tomi

    I Managed to narrow down the problem after seeing a double book on one of the calendars - One appointment hadn't synced to gcal in time! There was a appointment for 19.2. booked on 8.2, but it hadn't synced to gcal until 12.2. (I can see that in gcals ics file), and the provider had made an event to her gcal on 10.2.
    Other appointments had been synced throughout those days - there was, for example, an appointment made 11.2. for the same day, which had synced on 11.2 as supposed to. So there were multiple "syncs" which had skipped this one appointment for some reason, until it got synced at 12.2.

    Now, do you have any idea why this one appointment hadn't been synced?

  • Ash

    Hello @Tomi

    I hope you are well today.

    Well, thy sync depends on wp-cron, so your site needs some users in the front end. How much traffic do you have?

    Otherwise, you can manually sync with gcal grom Appointments > Settings > Google Calendar and clicking on manually import and export.

    Also, do you have any other plugin that deals with google service? Any plugin runs any wp cron job?

    Cheers
    Ash

  • Tomi

    Yes, I'm aware of that, and that's why I said in my previus post that someone made an appointment between those days (on 11.2.). So yeah, the site had traffic. We got ~5 appointments made on 9th and 10th day.
    I know that it is possible to manually import and export appointments, but if we can't trust the 2 way sync it is next to useless.
    Only other plugins activated are wpmu dashboard and child theme configurator, which has no dealings with google. No other plugins have ever been installed on this very simple site.

  • Ash

    Hello @Tomi

    I hope you are well today.

    As I said, the sync depends on wordpress cron, default it is set as 10 mins though. If you want you can decrease the duration with following code:

    add_filter( 'app_update_time', 'app_update_time_cb' );
    function app_update_time_cb($duration){
        $min = 5;
        return $min * 60;
    }

    You need to set $min in the above code.

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.