I develop a gateway module for magento 2 and when a customer who complete the registration process – i can get his email by :
$quote->getCustomerEmail()
but when i try to get a Guest email – i get a NULL value. There is a "Magento 2 way" to get it?
Javascript solution allready found:
Magento2: How to get guest email address in checkout?
Best Answer
If we take a look: vendor/magento/module-checkout/Model/Type/Onepage.php
So, basically, we can get the guest email:
$quote->getBillingAddress()->getEmail()
There are some other places:
vendor/magento/module-paypal/Model/Express/Checkout.php
vendor/magento/module-quote/Model/QuoteManagement.php