0.00  View Cart

Support Easy Booking: Google Calendar Calendar Event Title

This topic contains 1 reply, has 2 voices, and was last updated by  Ashanna 2 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5169

    Hybrid AWD
    Participant

    Is there any possibility to offer an option in the plugin on which data we want displayed at the event name? It would be great to include the last name of the order with the event title.

    #5172

    Ashanna
    Plugin's author

    Hello,

    Yes there is a filter available:

    add_filter( 'easy_booking_calendar_event_summary', 'add_custom_event_name', 10, 3 );
    
    function add_custom_event_name( $name, $order_item, $order ) {
    
        $name = '#' . absint( $order->get_order_number() ) . ' - ' . $order_item->get_name(); // Default name
        return $name;
    
    }

    You can also change the event description with this filter:

    add_filter( 'easy_booking_calendar_event_description', 'add_custom_event_description', 10, 3 );
    
    function add_custom_event_description( $description, $order_item, $order ) {
    
        $description = '<p>Client: ' . $order->get_formatted_billing_full_name() . '</p>';
        $meta_data = $order_item->get_formatted_meta_data();
    
        if ( ! empty( $meta_data ) ) {
    
            foreach ( $meta_data as $meta_id => $data ) {
                $description .= '<p>' . $data->display_key . ': ' . $data->value .'</p>';
            }
    
        }
    
        return $description;
    
    }

    This will display the client name and product options/variations. But you can change it to whatever you want 🙂

    Regards,
    Natasha

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.