Automattic\WooCommerce\Admin\Features\Fulfillments

FulfillmentsTracker::track_fulfillment_creationpublic staticWC 10.7.0

Track when a new fulfillment is successfully saved.

Tracked from: OrderFulfillmentsRestController::create_fulfillment(). Measures: Core adoption; whether merchants create full vs. partial shipments.

Method of the class: FulfillmentsTracker{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = FulfillmentsTracker::track_fulfillment_creation( $source, $initial_status, $fulfillment_type, $item_count, $total_quantity, $notification_sent ): void;
$source(string) (required)
The source of the fulfillment ("fulfillments_modal", "bulk_action", or "api").
$initial_status(string) (required)
The initial status of the fulfillment ("draft" or "fulfilled").
$fulfillment_type(string) (required)
Whether all remaining items were included ("full" or "partial").
$item_count(int) (required)
Total quantity of items in the fulfillment (sum of item quantities).
$total_quantity(int) (required)
Total quantity of all items in the order.
$notification_sent(true|false) (required)
Whether the customer notification was requested.

Changelog

Since 10.7.0 Introduced.

FulfillmentsTracker::track_fulfillment_creation() code WC 10.8.1

public static function track_fulfillment_creation( string $source, string $initial_status, string $fulfillment_type, int $item_count, int $total_quantity, bool $notification_sent ): void {
	WC_Tracks::record_event(
		'fulfillment_created',
		array(
			'source'            => $source,
			'initial_status'    => $initial_status,
			'fulfillment_type'  => $fulfillment_type,
			'item_count'        => $item_count,
			'total_quantity'    => $total_quantity,
			'notification_sent' => $notification_sent,
		)
	);
}