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.
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.

Methods

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

public track_order_search(array $order_ids, string $term, array $search_fields) : mixed
Parameters
$order_ids : array

Array of order_ids that are matches for the search.

$term : string

The string that was used in the search.

$search_fields : array

Fields that were used in the original search.

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