magepal / magento2-guest-to-customer

Guest to Customer for Magento2 - Quickly and easily convert existing guest checkout customers to registered customers.
http://www.magepal.com
68 stars 29 forks source link

Convert to Customer to working anymore. #18

Open JelleGe opened 1 year ago

JelleGe commented 1 year ago

Magento version #: 2.4.6-p2

Edition (EE, CE, OS, etc): CE

Expected behavior: Convert order to customer

Actual behavior: Error message; A customer with the same email address already exists in an associated website.

It's not possible anymore to convert a guest order to a customer, when there is already an existing customer with the same email address. Then we fetch the error: A customer with the same email address already exists in an associated website.

JeremyAtMethodMarketing commented 5 months ago

Magento changed how magento/module-customer/Model/AccountManagement.php handles the isEmailAvailable function. It now checks the GUEST_CHECKOUT_LOGIN_OPTION_SYS_CONFIG config and if it is set to false isEmailAvailable always returns true.
In magepal/magento2-guest-to-customer/Controller/Adminhtml/Customer/Index.php execute() if isEmailAvailable() evaluates to true it attempts to create a new customer, this is what throws the error. The customer does exist and the plugin errors out of customer creation and never reaches the merge guest with customer code.

iphigenie commented 4 days ago

@JeremyAtMethodMarketing thanks for spotting it! I don't like enabling this "guest checkout login" option BUT it does explain why this stopped working.

srenon commented 4 days ago

@JeremyAtMethodMarketing @iphigenie ... can you test these changes and let me know

https://github.com/magepal/magento2-guest-to-customer/commit/cf397a1396d6a457cd6dadaf6d1c9b620f270edb