EasyWayB Discussion

A Easy Way to Start Your Business Online

Woocommerce Confirm Booking Email to Show Customer and Additional Information

For Woocommerce Confirm Booking Email to Show Customer Information you need filter “woocommerce_bookings_gcalendar_sync”.
If you filter “woocommerce_bookings_gcalendar_sync” then update content of Google event when a booking is created or updated.
Woocommerce Booking use $event = apply_filters( 'woocommerce_bookings_gcalendar_sync', $event, $booking ); on includes/class-wc-bookings-google-calendar-connection.php file. You need to filter “woocommerce_bookings_gcalendar_sync”.

Enquiry For Your Project

Sample Code


add_filter( 'woocommerce_bookings_gcalendar_sync', 'easywayb_filter_bookings_gcalendar_sync', 10, 2 );
function easywayb_filter_bookings_gcalendar_sync( $event, $booking ){
$booking_id = $booking->id; // Woocommerce Booking ID
$order_id = $booking->order_id; // Woocommerce Order ID
$order = new WC_Order($order_id);

if(!empty($order)){
$description = '';
$description .= 'Customer name : '.$order->billing_first_name.' '.$order->billing_last_name;
$description .= 'Customer phone no : '.$order->billing_phone;
$description .= 'Customer shipping address : '.$order->shipping_address_1.', '.$order->shipping_address_2.', '.$order->shipping_city.', '.$order->shipping_state.', '.$order->shipping_postcode.', '.$order->shipping_country;
$description .= 'Customer provided note: : '.$order->get_customer_note();

$event['description'] .= $description;
}
return $event;
}

Or Visit https://stackoverflow.com/questions/71696716/woocommerce-confirm-booking-email-to-show-customer-and-additional-information.

Enquiry For Your Project