// ** // * Add custom tracking code to the view order page // */ add_action( 'woocommerce_view_order', 'my_custom_tracking' ); function my_custom_tracking(){ $order = wc_get_order( $order_id ); $order_id = $order->get_id(); // Get the order ID $parent_id = $order->get_parent_id(); // Get the parent order ID (for subscriptions…) $user_id = $order->get_user_id(); // Get the costumer ID $user = $order->get_user(); // Get the WP_User object echo $order_status = $order->get_status(); // Get the order status }
// ** // * Add custom tracking code to the view order page // */ add_action( 'woocommerce_view_order', 'my_custom_tracking' ); function my_custom_tracking(){ $order = wc_get_order( $order_id ); $order_id = $order->get_id(); // Get the order ID $parent_id = $order->get_parent_id(); // Get the parent order ID (for subscriptions…) $user_id = $order->get_user_id(); // Get the costumer ID $user = $order->get_user(); // Get the WP_User object echo $order_status = $order->get_status(); // Get the order status }