Description
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!
- Set up a Magento store with prefixes enabled in the customer configuration
- Go to checkout as a guest customer
- Select a prefix (e.g., "Herr" or "Frau") in the shipping/billing address form
- Complete the checkout process
- 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”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Activity
m2-assistant commentedon May 14, 2025
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.
@magento I am working on this
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.
m2-assistant commentedon May 14, 2025
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: 👇
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branchDetails
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced 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!
Issue: Confirmed
once verification is complete.engcom-Bravo commentedon May 16, 2025
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.
github-jira-sync-bot commentedon May 16, 2025
✅ Jira issue https://jira.corp.adobe.com/browse/AC-14705 is successfully created for this GitHub issue.
13 remaining items