WordPress at Your Fingertips
function is not described

WC_Order_Tracking::track_order_viewed() public WC 1.0

Send a Tracks event when an order is viewed.

{} It's a method of the class: WC_Order_Tracking{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Order_Tracking = new WC_Order_Tracking();
$WC_Order_Tracking->track_order_viewed( $order );
$order(WC_Order) (required)
Order.

Code of WC_Order_Tracking::track_order_viewed() WC 5.8.0

public function track_order_viewed( $order ) {
	if ( ! $order instanceof WC_Order || ! $order->get_id() ) {
		return;
	}
	$properties = array(
		'current_status' => $order->get_status(),
		'date_created'   => $order->get_date_created() ? $order->get_date_created()->format( DateTime::ATOM ) : '',
		'payment_method' => $order->get_payment_method(),
	);

	WC_Tracks::record_event( 'single_order_view', $properties );
}