Skip to content

Guest Prefix Not Saved to Quote Address 2.4.8 #39915

Open
@ajung2

Description

@ajung2

Summary

Guest Prefix Not Saved During Checkout

I've discovered an issue where prefix/salutation values (Herr/Frau) selected by guest customers during checkout are not being saved to the quote object and subsequently not appearing in orders.

We are using Magento 2.4.8 with Hyvä Checkout, and while customers can select a prefix in the checkout form, this value disappears before reaching the final order. All other address fields (first name, last name, street, etc.) transfer correctly.

The issue appears to be in how the prefix value is handled specifically for guest customers. The code in CustomerManagement::validateAddresses() attempts to set the prefix but the value is lost somewhere in the process:

if (empty($addresses) && $quote->getCustomerIsGuest()) {
    $billingAddress = $quote->getBillingAddress();
    $customerAddress = $this->customerAddressFactory->create();
    $customerAddress->setFirstname($billingAddress->getFirstname());
    // ...other fields...
}

I've confirmed this affects our Magento 2.4.8 installation using Hyvä Checkout with guest customers. The issue doesn't occur for logged-in customers, whose prefix values are correctly saved.

Examples

Steps to Reproduce and working patch!

  1. Set up a Magento store with prefixes enabled in the customer configuration
  2. Go to checkout as a guest customer
  3. Select a prefix (e.g., "Herr" or "Frau") in the shipping/billing address form
  4. Complete the checkout process
  5. Error Msg with "Prefix" not set

patch

diff --git a/vendor/magento/module-quote/Model/CustomerManagement.php b/vendor/magento/module-quote/Model/CustomerManagement.php
index dfeee78d7..d8d43e16b 100644
--- a/vendor/magento/module-quote/Model/CustomerManagement.php
+++ b/vendor/magento/module-quote/Model/CustomerManagement.php
@@ -162,6 +162,7 @@ class CustomerManagement
         if (empty($addresses) && $quote->getCustomerIsGuest()) {
             $billingAddress = $quote->getBillingAddress();
             $customerAddress = $this->customerAddressFactory->create();
+            $customerAddress->setPrefix($billingAddress->getPrefix());
             $customerAddress->setFirstname($billingAddress->getFirstname());
             $customerAddress->setLastname($billingAddress->getLastname());
             $customerAddress->setStreet($billingAddress->getStreet());

Proposed solution

The issue is in \Magento\Quote\Model\CustomerManagement::validateAddresses() 

$customerAddress = $this->customerAddressFactory->create();
$customerAddress->setPrefix($billingAddress->getPrefix()); // Add THIS! and it works
$customerAddress->setFirstname($billingAddress->getFirstname());

or

patch

diff --git a/vendor/magento/module-quote/Model/CustomerManagement.php b/vendor/magento/module-quote/Model/CustomerManagement.php
index dfeee78d7..d8d43e16b 100644
--- a/vendor/magento/module-quote/Model/CustomerManagement.php
+++ b/vendor/magento/module-quote/Model/CustomerManagement.php
@@ -162,6 +162,7 @@ class CustomerManagement
         if (empty($addresses) && $quote->getCustomerIsGuest()) {
             $billingAddress = $quote->getBillingAddress();
             $customerAddress = $this->customerAddressFactory->create();
+            $customerAddress->setPrefix($billingAddress->getPrefix());
             $customerAddress->setFirstname($billingAddress->getFirstname());
             $customerAddress->setLastname($billingAddress->getLastname());
             $customerAddress->setStreet($billingAddress->getStreet());

Release note

Fixed guest customer prefix (Mr/Mrs) not saving during checkout. Previously, salutations selected by guest customers were lost before reaching the final order, while all other address fields transferred correctly.

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
    Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
    Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
    Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
    Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Activity

added
Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
on May 14, 2025
m2-assistant

m2-assistant commented on May 14, 2025

@m2-assistant

Hi @ajung2. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

self-assigned this
on May 14, 2025
m2-assistant

m2-assistant commented on May 14, 2025

@m2-assistant

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
    5. Add label Issue: Confirmed once verification is complete.
    6. Make sure that automatic system confirms that report has been added to the backlog.
engcom-Bravo

engcom-Bravo commented on May 16, 2025

@engcom-Bravo
Contributor

Hi @ajung2,

Thanks for your reporting and collaboration.

We have tried to reproduce the issue in Latest 2.4-develop instance and we are able to reproduce the issue.Kindly refer the attached video.

Screen.Recording.2025-05-16.at.3.29.58.pm.mov

Not able to place the order with the guest.

Hence Confirming the issue.

Thanks.

added
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch
Priority: P2A defect with this priority could have functionality issues which are not to expectations.
on May 16, 2025
github-jira-sync-bot

github-jira-sync-bot commented on May 16, 2025

@github-jira-sync-bot

✅ Jira issue https://jira.corp.adobe.com/browse/AC-14705 is successfully created for this GitHub issue.

13 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: Cart & CheckoutComponent: CheckoutIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.8Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

Status

Ready for Development

Milestone

No milestone

Relationships

None yet

    Participants

    @engcom-Bravo@github-jira-sync-bot@ajung2@KrasnoshchokBohdan

    Issue actions

      Guest Prefix Not Saved to Quote Address 2.4.8 · Issue #39915 · magento/magento2