Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi to all,
how can I define to PayPal login page language IL?
this option not Appears.>
Thanks/
Comments
Comment #1
ntigh52 CreditAttribution: ntigh52 commentedHi,
I added the il on:
commerce_paypal_wps.module
tha , 'IL' in the end of array, and its work!
rszrama, Thanks again.
Comment #2
teebow CreditAttribution: teebow commentedI run a multi language + multi currency website.
How can I get the module to send the visitors to the right PayPal WPS country site depending on the site language?
As of now, I believe we can only choose 1 PayPal screen language within the admin settings.
Basically, the URL differs depending on the country code specified within the URL:
Thanks
Comment #3
Toxid CreditAttribution: Toxid commented@teebow,
You'd have to change the commerce_paypal_wps_server_url function into this:
Also, the settings for language appears to do nothing at this point. You'd have to do something like this to make the settings take effect:
Comment #4
phirex CreditAttribution: phirex commented@Toxid
Hi, i'm also using a multi currency and multi lingual site.
I tried your code, but it doesnt work on my side. paypal login page is still selected from the lang menu..
Comment #5
Toxid CreditAttribution: Toxid commentedYou're right, it seems that paypal only offers a limited amount of languages for login pages. If you try 'de' you get the german page. So it seems that the problem is on paypals end.
Comment #6
rszrama CreditAttribution: rszrama commentedYes, in fact I've just updated the list of supported languages and locales within the WPS module in this issue: [#]
You're not supposed to pass the parameter in via the URL but as part of the form (specifically the lc parameter). This only supports a subset of languages and locales, and those are now all represented as options on the settings form. As to the question above about selecting a different PayPal login page based on the current user's language, I think the best thing to do right now will be to alter the PayPal WPS parameters yourself using hook_commerce_paypal_wps_order_form_data_alter() (described in commerce_paypal_wps.api.php) to use whatever lc value you want based on your site's configuration.
I'm going to repurpose this as a feature request, though, to change the login page language based on the current user's language, but it's going to require more than a simple mapping of Drupal language codes since PayPal doesn't support every language and uses some customer 5 character codes for certain locales. We'll have to detect the current language, see if it maps to a known PayPal language, and change the lc parameter accordingly; otherwise we'll just leave it at the configured default login page language.
Comment #6.0
rszrama CreditAttribution: rszrama commented1
Comment #7
guy_schneerson CreditAttribution: guy_schneerson commentedThanks @rszrama hook works perfectly for me.
For whoever is interested a simple example of changing the language to English