Option to sync staff with their own Google Calendar

Issue #20 resolved
Željan Topić created an issue

No description provided.

Comments (9)

  1. johannesmutter

    I thinks it’s better to create a separate google calendars for each staff, instead of each product. So the staff would be able to subscribe to a certain calendar and get notified e.g. on their smartphone.

    Also I think it’s better for the visibility to display “Service/Product Title”, “Client Name” (and “Staff Name”):

    In Line 517:

            $event_id           = get_post_meta( $appointment_id, '_wc_appointments_gcal_event_id', true );
            $appointment        = get_wc_appointment( $appointment_id );
            $product            = $appointment->get_product();
            $product_title      = $product->post->post_title;
            $calendar_id        = get_post_meta( $product->id, '_wc_appointments_gcal_calendar_id', true );
            $order              = $appointment->get_order();
            $order_id           = get_post_meta( $appointment_id, '_appointment_order_item_id', true );
            $timezone           = wc_appointment_get_timezone_string();
            $staff              = get_userdata(get_post_meta( $appointment_id, '_appointment_staff_id', true ));
            $staff_name         = $staff->first_name;
            $customer           = get_userdata(get_post_meta($appointment_id, '_appointment_customer_id', true ));
            $customer_firstname = $customer->first_name;
            $customer_lastname  = $customer->last_name;
            $summary            = '◷ ' . $product_title .' - ' . $staff_name . ' - ' . $customer_firstname . ' ' . $customer_lastname . ' #' . $appointment_id;
            $description        = '';
    

    If one has many different products/services, the Google Calendar becomes quite overloaded:

    Bildschirmfoto 2016-04-22 um 21.26.06.png

  2. johannesmutter

    Can you add a filter that creates a google calendar for each staff instead of each product?

    I’m not sure if this is correct, but something like this:

    $calendar_sync_type = apply_filters( 'woocommerce_appointments_calendar_sync_type', 'product' );
    if ( $calendar_sync_type === 'staff' ) {
        // Sync by staff
        $staff              = get_userdata(get_post_meta( $appointment_id, '_appointment_staff_id', true ));
        $calendar_id  = get_post_meta( $staff->first_name, '_wc_appointments_gcal_calendar_id', true );
    else {
        // Sync by product
        $calendar_id  = get_post_meta( $product->id, '_wc_appointments_gcal_calendar_id', true );
    }
    
  3. Filipe Neves

    In your functions.php, maybe? Would be really super if you could share it! :) If you do, please let me know!

  4. Former user Account Deleted

    From what I understand in the above posts it is is possible to have different calendars sync for different products. Correct?

    How can I implement this?

  5. Željan Topić reporter

    Available from 3.7.0 onwards. Staff is able to sync events from all calendars (Google, Apple, Microsoft, ...) that support direct access through .ics.

  6. Log in to comment