Commerce 2 - how to get guest user email from custom submit handler? I'm altering &quot;review&quot; form in checkout process and adding custom submit handler. From that handler, if user is registered I can get it's email address as:
$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()-&gt;id());
$email = $user-&gt;getEmail();

But if I go to checkout as a guess user I can not get email of anonymous user that way - returns null.
How can I get guest user email address? I need a way to get email provided on previous checkout page, no matter if user is registered or not.
Found the way over the cart:
$store = \Drupal::service('commerce_store.current_store')-&gt;getStore();
$cart = \Drupal::service('commerce_cart.cart_provider')-&gt;getCart('default', $store);
$email = $cart-&gt;getEmail();