Automattic\WooCommerce\Internal\Fulfillments
FulfillmentsRenderer::register
Registers the hooks related to fulfillments.
Method of the class: FulfillmentsRenderer{}
No Hooks.
Returns
null. Nothing (null).
Usage
$FulfillmentsRenderer = new FulfillmentsRenderer(); $FulfillmentsRenderer->register();
FulfillmentsRenderer::register() FulfillmentsRenderer::register code WC 10.3.3
public function register() {
if ( OrderUtil::custom_orders_table_usage_is_enabled() ) {
// Hook into column definitions and add the new fulfillment columns.
add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'add_fulfillment_columns' ) );
// Hook into the column rendering and render the new fulfillment columns.
add_action( 'manage_woocommerce_page_wc-orders_custom_column', array( $this, 'render_fulfillment_column_row_data' ), 10, 2 );
} else {
// For legacy orders table, hook into column definitions and add the new fulfillment columns.
add_filter( 'manage_edit-shop_order_columns', array( $this, 'add_fulfillment_columns' ) );
// Hook into the column rendering and render the new fulfillment columns.
add_action( 'manage_shop_order_posts_custom_column', array( $this, 'render_fulfillment_column_row_data_legacy' ), 25, 1 );
}
// Hook into the admin footer to add the fulfillment drawer slot, which the React component will mount on.
add_action( 'admin_footer', array( $this, 'render_fulfillment_drawer_slot' ) );
// Hook into the admin enqueue scripts to load the fulfillment drawer component.
add_action( 'admin_enqueue_scripts', array( $this, 'load_components' ) );
// Hook into the order details page to render the fulfillment badges.
add_action( 'woocommerce_admin_order_data_header_right', array( $this, 'render_order_details_badges' ) );
// Hook into the order details before order table to render the fulfillment customer details.
add_action( 'woocommerce_order_details_before_order_table', array( $this, 'render_fulfillment_customer_details' ) );
// Initialize the renderer for bulk actions.
add_action( 'admin_init', array( $this, 'init_admin_hooks' ) );
// Hook into the order status text to append the fulfillment status.
add_filter( 'woocommerce_order_details_status', array( $this, 'render_fulfillment_status_text' ), 10, 2 );
add_filter( 'woocommerce_order_tracking_status', array( $this, 'render_fulfillment_status_text' ), 10, 2 );
}