Automattic\WooCommerce\Admin\Features\Fulfillments

FulfillmentsTracker::track_fulfillment_update │ public static │ WC 10.7.0

Track when an existing fulfillment is successfully updated.

Tracked from: OrderFulfillmentsRestController::update_fulfillment(). Measures: How often merchants modify fulfillments and which fields change most.

Метод класса: FulfillmentsTracker{}

Хуков нет.

Возвращает

void. Ничего (null).

Использование

$result = FulfillmentsTracker::track_fulfillment_update( $source, $fulfillment_id, $original_status, $changed_fields, $notification_sent ): void;
$source(строка) (обязательный)
The source of the update ("fulfillments_modal" or "api").
$fulfillment_id(int) (обязательный)
The ID of the fulfillment being updated.
$original_status(строка) (обязательный)
The status before the update ("draft" or "fulfilled").
$changed_fields(массив) (обязательный)
The changes as returned by Fulfillment::get_changes(). Core data props (e.g. 'status') at top level, meta changes under 'meta_data'. Serialized as JSON by WC_Tracks.
$notification_sent(true|false) (обязательный)
Whether a customer re-notification was requested.

Список изменений

С версии 10.7.0 Введена.

Код FulfillmentsTracker::track_fulfillment_update() WC 11.2.2

public static function track_fulfillment_update( string $source, int $fulfillment_id, string $original_status, array $changed_fields, bool $notification_sent ): void {
	WC_Tracks::record_event(
		'fulfillment_updated',
		array(
			'source'            => $source,
			'fulfillment_id'    => $fulfillment_id,
			'original_status'   => $original_status,
			'changed_fields'    => $changed_fields,
			'notification_sent' => $notification_sent,
		)
	);
}