Skip to content

[Bug] Don't save email field in the checkout page

Preconditions and environment

Module: hyva-themes/magento2-hyva-checkout v1.1.23

composer.lock

Steps to reproduce

  1. Add an item to the cart.
  2. Open the checkout page.
  3. Enter a correct email in the email field.
  4. 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());
    }
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information