WooCommerce Code Reference

WC_Orders_Tracking
in package

This class adds actions to track usage of WooCommerce Orders.

Table of Contents

init()  : mixed
Init tracking.
possibly_add_order_tracking_scripts()  : mixed
Adds the tracking scripts for product setting pages.
track_add_order_from_edit()  : mixed
Track "add order" button on the Edit Order screen.
track_created_date_change()  : mixed
Send a Tracks event when an order date is changed.
track_order_action()  : mixed
Track order actions taken.
track_order_search()  : mixed
Send a track event when on the Order Listing page, and search results are being displayed.
track_order_status_change()  : mixed
Send a Tracks event when an order status is changed.
track_orders_view()  : mixed
Send a Tracks event when the Orders page is viewed.
track_search_in_orders_list()  : mixed
Send a track event when on the Order Listing page, and search results are being displayed.

Methods

Send a track event when on the Order Listing page, and search results are being displayed.

public track_order_search(array<string|int, mixed> $order_ids, string $term, array<string|int, mixed> $search_fields) : mixed
Parameters
$order_ids : array<string|int, mixed>

Array of order_ids that are matches for the search.

$term : string

The string that was used in the search.

$search_fields : array<string|int, mixed>

Fields that were used in the original search.

Tags
deprecated
8.6.0
Return values
mixed

track_order_status_change()

Send a Tracks event when an order status is changed.

public track_order_status_change(int $id, string $previous_status, string $next_status) : mixed
Parameters
$id : int

Order id.

$previous_status : string

the old WooCommerce order status.

$next_status : string

the new WooCommerce order status.

Return values
mixed

track_search_in_orders_list()

Send a track event when on the Order Listing page, and search results are being displayed.

public track_search_in_orders_list() : mixed
Tags
since
8.6.0
Return values
mixed