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
And another example to get the customer details from the database:
$order = new WC_Order($order_id);
$order_detail['status'] = $order->get_status();
$order_detail['customer_first_name'] = get_post_meta($order_id, '_billing_first_name', true);
$order_detail['customer_last_name'] = get_post_meta($order_id, '_billing_last_name', true);
$order_detail['customer_email'] = get_post_meta($order_id, '_billing_email', true);
$order_detail['customer_company'] = get_post_meta($order_id, '_billing_company', true);
$order_detail['customer_address'] = get_post_meta($order_id, '_billing_address_1', true);
$order_detail['customer_city'] = get_post_meta($order_id, '_billing_city', true);
$order_detail['customer_state'] = get_post_meta($order_id, '_billing_state', true);
$order_detail['customer_postcode'] = get_post_meta($order_id, '_billing_postcode', true);