WC_Order::get_billing_email PHP Method

get_billing_email() public method

Get billing_email.
public get_billing_email ( string $context = 'view' ) : string
$context string
return string
    public function get_billing_email($context = 'view')
    {
        return $this->get_address_prop('email', 'billing', $context);
    }

Usage Example

 /**
  * Process customer: updating or creating a new customer/saved CC
  *
  * @param  WC_Order           $order          Order object
  * @param  WC_Payment_Token   $customer_token Payment Token
  * @param  string             $cart_token     CC Token
  */
 protected function process_customer($order, $customer_token = null, $cart_token = '')
 {
     // Are we saving a new payment method?
     if (is_user_logged_in() && isset($_POST['wc-simplify_commerce-new-payment-method']) && true === (bool) $_POST['wc-simplify_commerce-new-payment-method']) {
         $customer_info = array('email' => $order->get_billing_email(), 'name' => trim($order->get_formatted_billing_full_name()));
         $token = $this->save_token($customer_token, $cart_token, $customer_info);
         if (!is_null($token)) {
             $order->add_payment_token($token);
         }
     }
 }
All Usage Examples Of WC_Order::get_billing_email
WC_Order