-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fixed UPE country detection in Checkout for non-logged in users #9912
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +1 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gpressutto5, I could reproduce it prior to #9782.
The change is clear and makes sense, the only thing is we might want to double-check whether we want to hide all the payment methods if the billing country is not set (like we're doing with your change), or we show all of them instead. I think your approach is safer, because it protects against situation when someone uses a payment method which is ultimately not supported in their country.
This logic has not changed with my PR. It was already in the code, but it was broken because |
Changes proposed in this Pull Request
When there's no country selected in the checkout we try to get it from
wcpayCustomerData
which is unavailable, causing an error and displaying Klarna and Afterpay as an option when they shouldn't be displayed. This PR fixes that by usingwindow?.wcpayCustomerData
.Testing instructions
develop
: See Afterpay and Klarna are displayed and there's an error in the console.fix-upe-country-selection
: Afterpay and Klarna are not displayed and there's no error in the console.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge