How to get the current customer's email on the frontend checkout screen?

Solution

Decription

1. A registered customer case

You can just use the window.customerData object:

window.customerData.email

2. A guest customer case

The both guest case methods do not work when a registered customer uses an address from his address book. For a registered customer see the solution above.

Use the Magento_Checkout/js/checkout-data object.

Method 2.1. getValidatedEmailValue()

checkoutData.getValidatedEmailValue()

Method 2.2. getInputFieldEmailValue()

checkoutData.getInputFieldEmailValue()

Details:

See also: