We should allow the merchant to select the language of the landing page on Paypal's website.

This could either be a defined language, the website language (in case of multisite) or prefered user's language.

Documentation :
https://www.x.com/developers/paypal/documentation-tools/api/setexpressch...
https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=develo...

Comments

JulienD’s picture

Status: Active » Needs review
StatusFileSize
new8.74 KB

This patch is working well with the express checkout button on the cart form but when I complete the normal checkout process the language of the landing page is overridden by language of my country. I don't know if they override this, but the two ways of payment are using the same code.

swentel’s picture

Issue summary: View changes

Seems to be working great overall, still testing some more. One remark:

+++ b/modules/ec/commerce_paypal_ec.module
@@ -1089,12 +1099,91 @@ function commerce_paypal_ec_enabled($order = NULL) {
+function commerce_paypal_ec_locale_codes() {
+  return array(
+    'ast' => 'AT',
+    'de' => 'DE',
+    'es' => 'ES',
+    'en' => 'US',
+    'fr' => 'FR',
+    'it' => 'IT',
+    'nl' => 'NL',
+    'pl' => 'PL',
+    'pt-br' => 'BR',
+    'pt-pt' => 'PT',
+    'ru' => 'RU',
+    'zh-hans' => 'CN',
+    'zh-hant' => 'CN',
+  );
+}

I'm testing now with adding an alter here because we have dozens of custom locales that need to match, this allows custom sites to change this list.

mglaman’s picture

Status: Needs review » Needs work

Doe not apply, which is assumed the age of the patch.

tomtech’s picture

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.