I have a function that does this:
$order = new WC_Order($order_id);
$customer = new WC_Customer($order_id);
How can I get customer details fr
WooCommerce "Orders" are just a custom post type, so all the orders are stored in wp_posts and its order information in stored into wp_postmeta tables.
If you would like to get any details of WooCommerce's "Order" then you can use the below code.
$order_meta = get_post_meta($order_id);
The above code returns an array of WooCommerce "Order" information. You can use that information as shown below:
$shipping_first_name = $order_meta['_shipping_first_name'][0];
To view all data that exist in "$order_meta" array, you can use the below code:
print("");
print_r($order_meta);
print("");