WC_AJAX::get_order_details
Get order details.
Method of the class: WC_AJAX{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_AJAX::get_order_details();
WC_AJAX::get_order_details() WC AJAX::get order details code WC 10.8.1
public static function get_order_details() {
check_admin_referer( 'woocommerce-preview-order', 'security' );
if ( ! current_user_can( 'edit_shop_orders' ) || ! isset( $_GET['order_id'] ) ) {
wp_die( -1 );
}
$order = wc_get_order( absint( $_GET['order_id'] ) );
if ( $order ) {
include_once __DIR__ . '/admin/list-tables/class-wc-admin-list-table-orders.php';
wp_send_json_success( WC_Admin_List_Table_Orders::order_preview_get_order_details( $order ) );
}
wp_die();
}