WooCommerce Code Reference

FulfillmentsRenderer
in package

FulfillmentsRenderer class.

Table of Contents

$fulfillments_cache  : array<string|int, mixed>
Fulfillments cache, that holds the fulfillments for each order to eliminate fetching fulfillment records of an order on each column render.
add_fulfillment_columns()  : array<string|int, mixed>
Add the fulfillment related columns to the orders table, after the order_status column.
define_fulfillment_bulk_actions()  : array<string|int, mixed>
Define bulk actions for fulfillments.
filter_legacy_orders_by_shipping_provider()  : void
Filter legacy orders by shipping provider.
filter_legacy_orders_list_query()  : mixed
Filter the legacy orders list query to include fulfillment status.
filter_orders_by_shipping_provider()  : array<string|int, mixed>
Filter orders by shipping provider for the HPOS orders list.
filter_orders_list_table_query()  : array<string|int, mixed>
Apply the fulfillment status filter to the orders list.
handle_fulfillment_bulk_actions()  : string
Handle bulk actions for fulfillments.
init_admin_hooks()  : mixed
Initialize the hooks that should run after `admin_init` hook.
load_components()  : mixed
Loads the fulfillments scripts and styles.
register()  : mixed
Registers the hooks related to fulfillments.
render_fulfillment_column_row_data()  : mixed
Render the fulfillment status column.
render_fulfillment_column_row_data_legacy()  : mixed
Render the fulfillment column row data for legacy order list support.
render_fulfillment_customer_details()  : mixed
Render the fulfillment customer details in the order details page.
render_fulfillment_drawer_slot()  : mixed
Render the fulfillment drawer.
render_fulfillment_filters()  : mixed
Render the fulfillment filters in the orders table.
render_fulfillment_filters_legacy()  : mixed
Render the fulfillment filters in the legacy orders table.
render_fulfillment_status_text()  : string
Render the fulfillment status text in the order details page and the order tracking page.
render_order_details_badges()  : mixed
Render the fulfillment badges in the order details page.
render_shipping_provider_filter()  : void
Render the shipping provider filter dropdown in the orders table.
render_shipping_provider_filter_legacy()  : void
Render the shipping provider filter in the legacy orders table.
load_fulfillments_js_settings()  : void
Load the fulfillments JS settings.
register_fulfillments_assets()  : mixed
Register the fulfillment assets.
should_render_fulfillment_drawer()  : bool
Check if the fulfillment drawer should be rendered (admin only).
get_order_ids_by_shipping_provider()  : array<string|int, mixed>
Get order IDs that have fulfillments with a specific shipping provider.
maybe_read_fulfillments()  : array<string|int, mixed>
Fetches the fulfillments for the given order, caching them to avoid multiple fetches.
render_order_fulfillment_status_badge()  : mixed
Render the fulfillment status badge.
render_order_fulfillment_status_column_row_data()  : mixed
Render the fulfillment status column row data.
render_shipment_provider_column_row_data()  : mixed
Render the shipment provider column row data.
render_shipment_tracking_column_row_data()  : mixed
Render the shipment tracking column row data.

Properties

$fulfillments_cache

Fulfillments cache, that holds the fulfillments for each order to eliminate fetching fulfillment records of an order on each column render.

private array<string|int, mixed> $fulfillments_cache = array()

Methods

add_fulfillment_columns()

Add the fulfillment related columns to the orders table, after the order_status column.

public add_fulfillment_columns(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>

The columns in the orders page.

Return values
array<string|int, mixed>The modified columns.

define_fulfillment_bulk_actions()

Define bulk actions for fulfillments.

public define_fulfillment_bulk_actions(array<string|int, mixed> $actions) : array<string|int, mixed>
Parameters
$actions : array<string|int, mixed>

Existing actions.

Return values
array<string|int, mixed>

filter_legacy_orders_by_shipping_provider()

Filter legacy orders by shipping provider.

public filter_legacy_orders_by_shipping_provider(WP_Query $query) : void
Parameters
$query : WP_Query

The WP_Query object.

Tags
since
10.7.0
Return values
void

filter_legacy_orders_list_query()

Filter the legacy orders list query to include fulfillment status.

public filter_legacy_orders_list_query(WP_Query $query) : mixed
Parameters
$query : WP_Query

The WP_Query object.

Return values
mixed

filter_orders_by_shipping_provider()

Filter orders by shipping provider for the HPOS orders list.

public filter_orders_by_shipping_provider(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

The query arguments for the orders list.

Tags
since
10.7.0
Return values
array<string|int, mixed>The modified query arguments.

filter_orders_list_table_query()

Apply the fulfillment status filter to the orders list.

public filter_orders_list_table_query(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

The query arguments for the orders list.

Return values
array<string|int, mixed>The modified query arguments.

handle_fulfillment_bulk_actions()

Handle bulk actions for fulfillments.

public handle_fulfillment_bulk_actions(string $redirect_to, string $action, array<string|int, mixed> $post_ids) : string
Parameters
$redirect_to : string

The redirect URL.

$action : string

The action being performed.

$post_ids : array<string|int, mixed>

The post IDs being acted upon.

Return values
string

render_fulfillment_column_row_data_legacy()

Render the fulfillment column row data for legacy order list support.

public render_fulfillment_column_row_data_legacy(string $column_name) : mixed
Parameters
$column_name : string

The name of the column.

Return values
mixed

render_fulfillment_status_text()

Render the fulfillment status text in the order details page and the order tracking page.

public render_fulfillment_status_text(string $order_status, WC_Order $order) : string
Parameters
$order_status : string

The order status text.

$order : WC_Order

The order object.

Return values
stringThe fulfillment status appended order status text.

should_render_fulfillment_drawer()

Check if the fulfillment drawer should be rendered (admin only).

protected should_render_fulfillment_drawer() : bool
Return values
boolTrue if the fulfillment drawer should be rendered, false otherwise.

get_order_ids_by_shipping_provider()

Get order IDs that have fulfillments with a specific shipping provider.

private get_order_ids_by_shipping_provider(string $shipping_provider) : array<string|int, mixed>
Parameters
$shipping_provider : string

The shipping provider key to filter by.

Tags
since
10.7.0
Return values
array<string|int, mixed>Array of order IDs.

maybe_read_fulfillments()

Fetches the fulfillments for the given order, caching them to avoid multiple fetches.

private maybe_read_fulfillments(WC_Order $order) : array<string|int, mixed>
Parameters
$order : WC_Order

The order object.

Return values
array<string|int, mixed>The fulfillments for the order.

render_order_fulfillment_status_badge()

Render the fulfillment status badge.

private render_order_fulfillment_status_badge(WC_Order $order, string $order_fulfillment_status) : mixed
Parameters
$order : WC_Order

The order object.

$order_fulfillment_status : string

The fulfillment status of the order.

Return values
mixed

render_shipment_provider_column_row_data()

Render the shipment provider column row data.

private render_shipment_provider_column_row_data(WC_Order $order, array<string|int, mixed> $fulfillments) : mixed
Parameters
$order : WC_Order

The order object.

$fulfillments : array<string|int, mixed>

The fulfillments.

Return values
mixed

render_shipment_tracking_column_row_data()

Render the shipment tracking column row data.

private render_shipment_tracking_column_row_data(WC_Order $order, array<string|int, mixed> $fulfillments) : mixed
Parameters
$order : WC_Order

The order object.

$fulfillments : array<string|int, mixed>

The fulfillments.

Return values
mixed