Automattic\WooCommerce\Admin\Features\Fulfillments

FulfillmentsTracker::track_fulfillment_deletionpublic staticWC 10.7.0

Track when a fulfillment is successfully deleted.

Tracked from: OrderFulfillmentsRestController::delete_fulfillment(). Measures: How often merchants remove fulfillments and at what stage.

Method of the class: FulfillmentsTracker{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = FulfillmentsTracker::track_fulfillment_deletion( $source, $fulfillment_id, $status_at_deletion, $notification_sent ): void;
$source(string) (required)
The source of the deletion ("fulfillments_modal" or "api").
$fulfillment_id(int) (required)
The ID of the fulfillment being deleted.
$status_at_deletion(string) (required)
The status at the time of deletion ("draft" or "fulfilled").
$notification_sent(true|false) (required)
Whether a deletion notification was requested.

Changelog

Since 10.7.0 Introduced.

FulfillmentsTracker::track_fulfillment_deletion() code WC 10.7.0

public static function track_fulfillment_deletion( string $source, int $fulfillment_id, string $status_at_deletion, bool $notification_sent ): void {
	WC_Tracks::record_event(
		'fulfillment_deleted',
		array(
			'source'             => $source,
			'fulfillment_id'     => $fulfillment_id,
			'status_at_deletion' => $status_at_deletion,
			'notification_sent'  => $notification_sent,
		)
	);
}