WC_AJAX::load_order_items()public staticWC 1.0

Load order items via ajax.

Method of the class: WC_AJAX{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_AJAX::load_order_items();

WC_AJAX::load_order_items() code WC 8.7.0

public static function load_order_items() {
	check_ajax_referer( 'order-item', 'security' );

	if ( ! current_user_can( 'edit_shop_orders' ) || ! isset( $_POST['order_id'] ) ) {
		wp_die( -1 );
	}

	// Return HTML items.
	$order_id = absint( $_POST['order_id'] );
	$order    = wc_get_order( $order_id );
	include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
	wp_die();
}