woocommerce_analytics_update_order_stats_data хук-фильтрWC 1.0

Filters order stats data.

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

add_filter( 'woocommerce_analytics_update_order_stats_data', 'wp_kama_woocommerce_analytics_update_order_stats_data_filter', 10, 2 );

/**
 * Function for `woocommerce_analytics_update_order_stats_data` filter-hook.
 * 
 * @param array    $data  Data written to order stats lookup table.
 * @param WC_Order $order Order object.
 *
 * @return array
 */
function wp_kama_woocommerce_analytics_update_order_stats_data_filter( $data, $order ){

	// filter...
	return $data;
}
$data(массив)
Data written to order stats lookup table.
$order(WC_Order)
Order object.

Где вызывается хук

DataStore::update()
woocommerce_analytics_update_order_stats_data
woocommerce/src/Admin/API/Reports/Orders/Stats/DataStore.php 509-526
$data = apply_filters(
	'woocommerce_analytics_update_order_stats_data',
	array(
		'order_id'           => $order->get_id(),
		'parent_id'          => $order->get_parent_id(),
		'date_created'       => $order->get_date_created()->date( 'Y-m-d H:i:s' ),
		'date_created_gmt'   => gmdate( 'Y-m-d H:i:s', $order->get_date_created()->getTimestamp() ),
		'num_items_sold'     => self::get_num_items_sold( $order ),
		'total_sales'        => $order->get_total(),
		'tax_total'          => $order->get_total_tax(),
		'shipping_total'     => $order->get_shipping_total(),
		'net_total'          => self::get_net_total( $order ),
		'status'             => self::normalize_order_status( $order->get_status() ),
		'customer_id'        => $order->get_report_customer_id(),
		'returning_customer' => $order->is_returning_customer(),
	),
	$order
);

Где используется хук в WooCommerce

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