Automattic\WooCommerce\Internal\Orders
OrderAttributionController::send_order_tracks
Send order source data to Tracks.
Метод класса: OrderAttributionController{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->send_order_tracks( $source_data, $order );
- $source_data(массив) (обязательный)
- The source data.
- $order(WC_Order) (обязательный)
- The order object.
Код OrderAttributionController::send_order_tracks() OrderAttributionController::send order tracks WC 10.7.0
private function send_order_tracks( array $source_data, WC_Order $order ) {
$origin_label = $this->get_origin_label(
$source_data['source_type'] ?? '',
$source_data['utm_source'] ?? '',
false
);
$tracks_data = array(
'order_id' => $order->get_id(),
'source_type' => $source_data['source_type'] ?? '',
'medium' => $source_data['utm_medium'] ?? '',
'source' => $source_data['utm_source'] ?? '',
'device_type' => strtolower( $source_data['device_type'] ?? 'unknown' ),
'origin_label' => strtolower( $origin_label ),
'session_pages' => $source_data['session_pages'] ?? 0,
'session_count' => $source_data['session_count'] ?? 0,
'order_total' => $order->get_total(),
'customer_registered' => $order->get_customer_id() ? 'yes' : 'no',
);
if ( function_exists( 'wc_admin_record_tracks_event' ) ) {
wc_admin_record_tracks_event( 'order_attribution', $tracks_data );
}
}