magepal / magento2-edit-order-email

Magento2 - Edit Order Email from Admin
http://www.magepal.com
34 stars 13 forks source link

No error message when updating customer email which is already existed in customer record #4

Open albertwong25 opened 4 years ago

albertwong25 commented 4 years ago

When updating customer email (checked "Update Customer Record") which is already existed in customer record, there is no error message. Although the email is updated in order, it remains un-change in customer record due to unique email rule.

Error message should be showing up to notice user that the email in customer record remain un-change, instead of saying "Email address successfully changed".

srenon commented 4 years ago

@albertwong25 ... does this mean that the customer technically places this order as the wrong customer (since that email exists/the customer has 2 accounts) for another customer?

albertwong25 commented 4 years ago

Yes, a customer can own more than one account with different emails.

Here is a simple use case: A customer registered an account long time ago. He didn't remember the password so that he registered another account. He made an order with the new account. Then he called us and said he want to change the order email together with the account email, but he didn't tell us that he had an old account. We changed the email in order record page by using this extension, however, the extension didn't show the duplicate email error. We through the account email is already updated since the message said "successfully changed", actually it didn't.

srenon commented 4 years ago

What is the expected outcome?

  1. Should it not update the order email, and display an error message since the email belongs to another customer

  2. Update the order and display and error message for updating customer

albertwong25 commented 4 years ago

I think 2 will be better as this extension originally designed for updating order email. Just show a warning message to indicate that the customer email cannot be updated due to duplicate email.

laucat commented 3 years ago

Hi, I think I'm encountering this same issue as well. The order email was updated but the customer record's email was not updated, potentially due to a unique email check. "Update Customer Record" was checked.

My scenario is slightly different than the above.

In my multi-store M2, my test customer has one customer account in each store (website), all using the same email address. Since we have 4 store fronts, there are 4 customer accounts using the same address.

Like so: store A - email X store B - email X store C - email X store D - email X

While testing the email update for an order made in "store C" with "email X" customer, I can update the order email and customer email to "email Y".

But when I try to update the same order back to "email X" (with checked "Update Customer Record"), only the order's email was updated, the customer email remains as "email Y", even though the message says update was successful.

I also think the 2) expected outcome above will be better. As long as there is a message/alert informing the admin that the customer record's email wasn't updated due to duplicate email, then they can take an extra step to manually update the customer record.

In my case though, "email X" is unique for "store C", it just isn't an unique email across customer accounts when all stores are combined.