wpf_woocommerce_attendee_data

Overview

This filter is run during a WooCommerce checkout, while WP Fusion is preparing to sync FooEvents event attendees to your CRM. It can be used to modify the data that is synced for each attendee.

To use the code examples below, add them to your active theme’s functions.php file.

Parameters

  • $update_data: (array) This is an array of key value pairs representing WordPress meta fields and their corresponding values.
  • $attendee: (array) The FooEvents attendee data.
  • $order_id: (int) The WooCommerce order ID

Examples

Sync event dates in separate fields

This example syncs the event date in a separate field, identified by the event ID (like event_date_123).

It can be used to store event dates in multiple custom CRM fields when a customer registers for multiple events simultaneously.

function sync_booking_dates( $update_data, $attendee, $order_id ) {

	$product_id = $attendee['WooCommerceEventsProductID'];

	$update_data[ 'event_date_' . $product_id ] = get_post_meta( $product_id, 'WooCommerceEventsDate', true );

	return $update_data;

}

add_action( 'wpf_woocommerce_attendee_data', 'sync_booking_dates', 10, 3 );

Was this helpful?