Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set email when creating order for express payment #2577

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

AlexP11223
Copy link
Contributor

Looks like the email was not set in WooCommerceOrderCreator, so for guest orders via express checkout with disabled confirmation it was remaining empty (for logged in customers it was setting email to the WP user email if empty during saving).

So now setting the order email to the email from WC()->customer (retrieving email instead of billing_email because it seems to be the WC behavior) , or to the PayPal payer email if empty.

Steps to Test

GIVEN the PayPal shipping callback is enabled
AND the customer is a guest user
WHEN completing a PayPal express payment
THEN the WooCommerce order displays the buyer's PayPal email address in both the regular Email and PayPal Email fields

GIVEN the PayPal shipping callback is enabled
AND the customer is a logged-in user with a saved email address in their profile
WHEN completing a PayPal express payment
THEN the WooCommerce order displays the email address from the buyer's WooCommerce profile in the regular Email field
AND the PayPal account email address in the PayPal Email field

Copy link
Collaborator

@Narek13 Narek13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@Dinamiko Dinamiko merged commit 85660ab into trunk Oct 7, 2024
9 checks passed
@Dinamiko Dinamiko deleted the PCP-3534-guest-email branch October 7, 2024 08:37
@Dinamiko Dinamiko added this to the 2.9.3 milestone Oct 10, 2024
@Dinamiko Dinamiko added the enhancement New feature or request label Oct 10, 2024
@Dinamiko Dinamiko mentioned this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants