Closed AmeenJalali closed 4 years ago
Hi there @AmeenJalali.
What is your site's language set to in your WordPress settings?
That function you linked to, get_paypal_locale()
only returns en_US
if your store is based in the US, which doesn't apply to you, or your site's language isn't one that PayPal supports.
When I checked on my local site, I found that if I set it to English (Australia), then en_AU
is sent to PayPal.
Could you confirm what your site language is set to? You can find that setting in Settings > General from your WordPress dashboard.
Thanks for helping @james-allan, it works properly!
Thanks @AmeenJalali, glad to hear it's working now :) Closing this out
Describe the bug
Our website is based in Australia. When we changed the landing page from login (PayPal account) to billing (Non-PayPal account), after clicking on PayPal smart button on the checkout page, we redirect to PayPal link like:
sandbox.paypal.com/checkoutnow?locale.x=en_US&fundingSource=paypal&sessionID=f542d1d07e_mdsdjy6mzm&buttonSessionID=83529fa81e_msd26mjc6mja&env=sandbox&fundingOffered=paypal&logLevel=warn&sdkMeta=eyJ1cmwiOiJod2Rwczo123123asdaxxvYmplY3RzLfNvbS9hcGkvY2hs2tvdXQuan23D&uid=f0e347a45a&version=4&token=EC-9S631129131J&xcomponent=1#/checkout/guest
If you see, you can find out the
locale.x
set to en_US. This causes the default country on the PayPal website set to the USA and not Australia. Because get_paypal_locale() function always returns US country as locale parameter in the URL and it's very bad for customers. They are forced to change the country.To reproduce
Expected behavior
I expected when our store based in Australia, after clicking on the PayPal button, the default location on the PayPal website set to Australia, not the USA.
Environment (please complete the following information):