Add option to set location to Google Events for synced Appointments

Issue #590 resolved
Valentina R created an issue

Would it be possible to add it to the location field in the Google Calendar event? If the address was in the location field, then it could easily be opened in Google Maps.

Requester here and here.

Comments (6)

  1. Kevin Neynaber

    For those providing mobile services such as my client, this feature would be HUGE. Ideally, we could use the shipping address (we call it the service address) as often billing addresses are different than where the end-user wants the service to occur.

    By setting the location in the google event to the shipping address (or billing if not available), this would save the team a lot of manual updating.

    Thank you for your great work on this tool!

  2. Željan Topić

    This is possible when hooking into a filter ‘woocommerce_appointments_gcal_sync', but since appointments don’t have a dedicated location field, you’ll need to send data either from a store location field or from an add-on field, where customer selects a location. Not sure, how customers implement locations, so it may vary.

  3. Kevin Neynaber

    Thanks for the update! To clarify, there’s no way to pull the Woocommerce billing address (or shipping address if available) into the gcal sync?

    The purpose to have the address in gcal is for the service industry. Contractors, beauty, cleaners, etc – those who go to the customer. If a service always occurs at the same location (a shop for instance), then there’s not purpose in having the address in gcal.

    For service people, being able to open gcal and see where they are going for an appointment would be awesome.

    Best wishes!

  4. Marc McHale

    I’m all for this. And something similar on a related note, which I assume would be need as part of the ground work to make the above happen. The information above should be available in the “all appointments” list.

    Currently that list shows the following:

    • Appointment (Customer name, customer status, payment status, and order number and order status)
    • When (Date, time and length)
    • Product (product and quantity)
    • Staff (Staff Member)
    • Actions
    • Likes (Why?)

    What would be really awesome by default would be the following:

    • When (Date, time and length)
    • Appointment (Customer name, customer status, payment status, and order number and order status)
    • Customer Phone (Home and Mobile if supplied)
    • Customer Address (Both Billing and Shipping (Service))
    • Product (product and quantity) (Include add-on info?)
    • Staff (Staff Member)
    • Actions

    Default order should always be “When” Ascending - Not order number. (I can’t think of a reason why any other way is useful - doesn't mean there isn't one!) Next/Current appointment at the top.

    Default view should not show orders in the past. (I can’t think of a reason why any other way is useful - doesn't mean there isn't one!) If you are looking for something in the past, most efficient way is to search, surely?

    Which would lead onto all that info being automatically added to the calendar, and the gsync service.

    I haven't had a good look, but I assume the appointment object just doesn't have these fields? I assume they would have to be dynamically linked to the attached order. I guess if you start that end, tagging that info into the google sync and other displays should be relatively easy?

    I’m not an experienced wordpress/woocommerce coder, but I have experience in coding. I’m learning this fast, but not quite fast enough it would seem!

    Thanks for a great product.

  5. Simon Gondeck

    I wanted to follow up on this feature request. Is there a way to add the "location" of the Google Event as the Billing or Shipping address of an Appointment/Order to Google Calendar?

    For example, in the class-wc-appointments-gcal.php I see you set the summary and description of a Event. However, is there a way to set the location as the Order Billing Address? Could this also include a filter that we could use to set the Order Shipping Address instead?

    Could the new filter "woocommerce_appointments_gcal_sync_parameters" be used perhaps? Or is there some other way?

    https://developers.google.com/calendar/create-events

  6. Valentina R reporter

    It can be done with this Code snippet: `add_filter( 'woocommerce_appointments_gcal_sync', function( $data, $appointment ) {

    $order = $appointment->get_order();

    $data['location'] = ['Unicorn road 255, 1000 Nowhere, France'];

    return $data;
    

    }, 10, 2);`

  7. Log in to comment