[Bug] Don't save email field in the checkout page
Preconditions and environment
Module: hyva-themes/magento2-hyva-checkout v1.1.23
Steps to reproduce
- Add an item to the cart.
- Open the checkout page.
- Enter a correct email in the email field.
- Reload the page.
Expected result
The email field should retain the entered email address.
Actual result
The email field is empty after the page reloads.
Additional information
In older versions of this module, the email was saved using specific code. In the latest version, this code was removed.
Old Version: hyva-themes/magento2-hyva-checkout v1.1.10
Relevant Code (from v1.1.10):
vendor/hyva-themes/magento2-hyva-checkout/src/Model/Form/EntityFormModifier/WithAuthenticationModifier.php:188
private function applyGuestAddressEmailFieldValue(Address $address, EntityFormInterface $form): void
{
if ($this->sessionCustomer->isLoggedIn()) {
return;
}
$emailField = $form->getField(AddressInterface::KEY_EMAIL);
if (! $emailField) {
return;
}
$emailField->setValue($address->getEmail());
}