Forums / PayPal Express Checkout support / PayPal Express Checkout Default Language

PayPal Express Checkout Default Language

Views: 13,690

Results 1 to 17 of 17
3 Sep 2008, 5:34 AM
#1
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

PayPal Express Checkout Default Language

My client is located in Italy and so her account is setup through paypal.com but resides at paypal.it. The Zen cart site language is English and we would like the PayPal default language to also be English. However, I've just been informed by a potential customer in Germany that our PayPal page is in Italian. When I had a friend check the language from the US, PayPal was in English. :huh:

As I am also in Italy, it is difficult to know which language PayPal is defaulting to elsewhere.

What steps can I follow to be certain that the default PayPal page is in English or in the local language in which the user resides?

We are running on Zen 1.3.8a

Thank you

4 Sep 2008, 6:00 AM
#2
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

Hmmm... in this post Dr byte is saying:

The module is designed to automatically operate in the primary language of the country your store is located in. You set this in Admin->Configuration->My Store->Country.

Since my store is located in Italy I obviously have that set to Italy but that is not the default language I want. However, if I change that to another English-speaking country just for the sale of the English language default it would have other repercussions, correct?

I thought that PayPal defaulted to the language of the country it was in and if all else failed reverted to English.

Help...? :cry:

4 Sep 2008, 6:16 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPal Express Checkout Default Language

If you don't like the way it works, just change it. The code that determines the locale submitted to PayPal is this:```
function getLanguageCode() {
$lang_code = '';
$storeISO = zen_get_countries(STORE_COUNTRY, true);
if (in_array(strtoupper($storeISO['countries_iso_code_2']), array('US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) {
$lang_code = strtoupper($storeISO['countries_iso_code_2']);
} elseif (in_array(strtoupper($_SESSION['languages_code']), array('EN', 'US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) {
$lang_code = $_SESSION['languages_code'];
if (strtoupper($lang_code) == 'EN') $lang_code = 'US';
}
return strtoupper($lang_code);
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Sep 2008, 6:33 AM
#4
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

Where is that? I'm not seeing it in includes/modules/payment/paypal.php.

Also what about this chunk of code? I had seen reference to the fact that it automatically defaults to country browser, although I don't know where to place it:

'lc' => $order->customer['country']['iso_code_2'],

Plus, in My Store>Language Selector: Should the default language be based on the Store preferences, or the customer's browser settings? It is now set to Store's default settings.

Thanks

4 Sep 2008, 4:23 PM
#5
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

OK, I found that bit of code in: includes/modules/payment/paypaldp.php

However, even if I stare at it really hard I have no idea how to make it do what I want.. :smartalec:

I've been told by a customer in Germany that the PayPal page is in Italian, which is where the brick-and-mortar store is located. Could anyone give me some pointers on how to correctly modify the code so that the PayPal page defaults to the language of the country the customer resides in or to English?

Thanks!!

4 Sep 2008, 5:00 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPal Express Checkout Default Language

For express checkout, you'll want to be working with the paypalwpp.php file, not the paypaldp.php file.

To base the locale selection on the customer's language choice, change this:[B]} elseif[/B] (in_array(strtoupper($_SESSION['languages_code']), array('EN', 'US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) { to this:```
[B] }
if [/B]
(in_array(strtoupper($_SESSION['languages_code']), array('EN', 'US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) {

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Sep 2008, 12:53 PM
#7
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

Thanks for your help. That seems to have worked well.

I wanted to ask, if I could, what is the recommended setting for admin/configuration/My Store/Language Selector? (Should the default language be based on the Store preferences, or the customer's browser settings?) Right now it is set to the Default: Store's default settings. Does that setting have any effect on PayPal?

Also, I see that on the PayPal checkout page there is a language dropdown selector (which is great!) but with a limited number of languages (English, French, Spanish & Japanese). Is it possible to add to that list?

Thanks again.

5 Sep 2008, 1:09 PM
#8
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,668
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

Also, I see that on the PayPal checkout page there is a language dropdown selector (which is great!) but with a limited number of languages (English, French, Spanish & Japanese). Is it possible to add to that list?

On the PayPal site? That is a question you'll have to ask them.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

5 Sep 2008, 8:46 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPal Express Checkout Default Language

MeltDown:

What is the recommended setting for admin/configuration/My Store/Language Selector? (Should the default language be based on the Store preferences, or the customer's browser settings?) Right now it is set to the Default: Store's default settings. Does that setting have any effect on PayPal?
If you change it to "browser", then your customer's browser is going to tell your store what language to display in.
And, with the code change you just made, the language your store is in when they make their purchase, is the language that PayPal will display in ... if PayPal supports that language.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

10 Oct 2010, 6:46 AM
#10
marcelarr avatar

marcelarr

New Zenner

Join Date:
Oct 2008
Posts:
54
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

DrByte:

For express checkout, you'll want to be working with the paypalwpp.php file, not the paypaldp.php file.

To base the locale selection on the customer's language choice, change this:[B]} elseif[/B] (in_array(strtoupper($_SESSION['languages_code']), array('EN', 'US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) { to this:```
[B] }
if [/B]
(in_array(strtoupper($_SESSION['languages_code']), array('EN', 'US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) {



Im working on version 1.3.9.g, where could I go about finding that as I dont see in the specified file... cann you point me in the right direction?
9 Jan 2011, 3:17 PM
#11
weatherman avatar

weatherman

New Zenner

Join Date:
Jan 2011
Posts:
1
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

Version 1.3.9

Try changing line 976 (version 1.3.9h) in includes/modules/payment/paypal/paypalwpp.php and change true to false.

The line you are looking for is:

$storeISO = zen_get_countries(STORE_COUNTRY, true);

which should be changed into:

$storeISO = zen_get_countries(STORE_COUNTRY, false);

Now Paypal (Express) should be directing your users based on either the default language or, if enabled, the language preference as set by the user.

:cool:

11 May 2011, 3:08 PM
#12
breezie1977 avatar

breezie1977

New Zenner

Join Date:
Nov 2008
Posts:
14
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

Ok.. I've tried every variation of every option noted in this thread and can't for the life of me get this to work.

Although, having said that, my debug files say it IS working.... but PayPal continues to stubbornly pop up in the wrong language - Japanese.

My store is for foreigners in Japan and is based in Japan, but I do get some Japanese customers too. So I'm trying to get PayPal to react the customers browser and personal zen cart settings and show PayPal accordingly. I can see in the debug files coming through from PayPal Express that my [LOCALECODE] is going through to PayPal just fine. In fact I have implemented all the suggestions in this thread and can quite skillfully adjust this code to whatever I want. No matter what code shows, no matter what I have as my Store Location, PayPal ALWAYS pops up in Japanese.

Here is an example of one of the thousands of debug files I have created over the past 10 hours trying to sort this out:

2011-05-11 11:33:59

(live transaction) --> https://api-3t.paypal.com/nvp Request Headers:
Array
(
[0] => Content-Type: text/namevalue
[1] => X-VPS-Timeout: 45
[2] => X-VPS-VIT-Client-Type: PHP/cURL
[3] => X-VPS-VIT-Integration-Product: PHP::Zen Cart - WPP-NVP
[4] => X-VPS-VIT-Integration-Version: 1.3.8a
)

Request Parameters: {SetExpressCheckout} Array (
[LOCALECODE] => US
[PAYMENTACTION] => Sale
[ADDROVERRIDE] => 1
[SHIPTONAME] => Tony Bunnister
[SHIPTOSTREET] => scvbkjn
[SHIPTOSTREET2] => nkjnkjn
[SHIPTOCITY] => jnknkn
[SHIPTOZIP] => Ishikawa
[SHIPTOSTATE] => kjnkjnk
[SHIPTOCOUNTRYCODE] => JP
[EMAIL] =>
[PHONENUM] =>
[AMT] => 3,380.00
[RETURNURL] =>
[CANCELURL] =>
[PAGESTYLE] => Primary
[METHOD] => SetExpressCheckout
[CURRENCYCODE] => JPY
[USER] =>
[PWD] =>
[VERSION] => 3.2
[SIGNATURE] => ****************************************************
)

Response:
Array
(
[TOKEN] => EC-52U92443533900445
[TIMESTAMP] => 2011-05-11T14:34:01Z
[CORRELATIONID] => 5af643a6d3176
[ACK] => Success
[VERSION] => 3.2
[BUILD] => 1882144
[CURL_ERRORS] =>
)

[check_valid] => true
[language] => english
[languages_id] => 1
[languages_code] => en
[currency] => JPY
[today_is] => 2011-05-11
[updateExpirations] => 1
[session_counter] => 1
[customers_ip_address] => 219.29.222.172
[customer_id] => 85
[customer_default_address_id] => 99
[customers_authorization] => 0
[customer_first_name] => Tony
[customer_last_name] => Bunnister
[customer_country_id] => 107
[customer_zone_id] => 0
[valid_to_checkout] => 1
[sendto] => 99
[payment] => paypalwpp

address details from override check:Array (
[entry_firstname] => Tony
[entry_lastname] => Bunnister
[entry_street_address] => scvbkjn
[entry_suburb] => nkjnkjn
[entry_city] => jnknkn
[entry_postcode] => Ishikawa
[entry_country_id] => 107
[entry_zone_id] => 0
[entry_state] => kjnkjnk
[zone_code] => kjnkjnk
[countries_iso_code_2] => JP
)

I've asked someone to go through checkout from the UK and they said that PayPal popped up perfectly in English. So obviously it's to do with where the user is. But that would be [LOCALECODE] right?!!?

Any help on this would be greatly appreciated but I'm starting to get the impression, the issue is with PayPal and not with zencart.

Thanks,

Tony:bangin:

11 May 2011, 4:03 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPal Express Checkout Default Language

breezie1977:

Although, having said that, my debug files say it IS working.... but PayPal continues to stubbornly pop up in the wrong language - Japanese.

...

Any help on this would be greatly appreciated but I'm starting to get the impression, the issue is with PayPal and not with zencart.
Yes, it seems to be an issue on the PayPal side.
Contact them: https://www.paypal.com/mts

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 May 2011, 2:38 PM
#14
breezie1977 avatar

breezie1977

New Zenner

Join Date:
Nov 2008
Posts:
14
Plugin Contributions:
0

Re: PayPal Express Checkout Default Language

Just to update you all with my issue - I've had no luck whatsoever!!

I've been chatting with the people at https://www.paypal.com/mts who have been fantastic. Really quick replies and, after not getting anywhere with their suggestions, they even advised me to do something which would "definitely fix it, but not a textbook method".

Even that didn't work.

First of all they said that if you can see the LOCALECODE changing and the site still doesn't show up in the right language then something is fishy. I reassured them I could change this code and they came back to me asking me to go into my PHP admin on my sever and alter the database entry which tells Zen Cart where to send PayPal customers. I was asked to alter it from "www.paypal.com/cgi-bin/webscr", to "www.paypal.com/us/cgi-bin/webscr" - something the guy said he wasn't sure "how much mileage" I'd get out of it, but as a quick fix it would work.

This sounded great and I was thrilled, until I checked the database only to find it was ALREADY set to the us version!!!! Altered it to the UK one to test. No dice.

Perhaps its something to do with my cookies (although I've been clearing them after every attempt to resolve this) or perhaps it's because when I registered with PayPal I did so on the Japanese site, who knows.

I've seen something called "payflow" which seems like it can be set to UK or US versions. Would PayFlow help me out here? Any other suggestions from anyone out there?!

Thanks in advance,

Tony:lamo:

16 May 2011, 5:50 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPal Express Checkout Default Language

Payflow is a credit card gateway, and is a completely different product than Express Checkout.

Best to continue working with PayPal to figure out why their system is picking a different language than what it's being told to use.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Nov 2013, 1:58 PM
#16
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: PayPal Express Checkout Default Language

FYI
To avoid anyone else wasting time on this.

I noticed that the language of the Paypal payment page was inconsistent…and after a bit of reading and a lot of testing I find the following to be true.
There is a parameter LOCALECODE which you can send to Paypal to (in theory) determine the page language but they very helpfully ignore it completely if there is a SHIPTOCOUNTRYCODE parameter (the country of the billing address).
They use the SHIPTOCOUNTRYCODE as though its a language code.
Paypal seem to think that everyone in the same country speaks the same language just like in the USA(!)

I tried to comment out various instances of SHIPTOCOUNTRYCODE in paypalwpp.php to generate an empty or no SHIPTOCOUNTRYCODE but I think this is a required parameter by Paypal so it would always cause an error.

So unless someone can tell me how to omit this parameter without causing an error, it seems you have to live with this idiocy.

Depending on the SHIPTOCOUNTRYCODE of the order, Paypal may (ie sometimes there is no choice) offer a language selector drop-down with some language options related to the country selected, but not all language options are offered!

Rubbish.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

4 Nov 2013, 1:15 PM
#17
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: PayPal Express Checkout Default Language

Just to clarify :blink: what you can expect dealing with Paypal with a multi-lingual shop, here are the results of my testing.

I surmise that:

  1. First Paypal take the shipping country (SHIPTOCOUNTRY) as the primary reference. For each country they may or may not have multiple (preferred) languages associated with it. Hence sometime there's a language selection drop-down and sometimes not.

  2. IF your language (LOCALECODE) is in their list for that country, you get what you asked for.
    If not, you get whatever Paypal has decided to offer for that country, with maybe a drop down, or not, who knows.

In short, una caca.

Note that I have found no written evidence to support my crackpot theory. All Paypal's documentation states that LOCALECODE sets the language, which is evidently not true.

Further reading for insomniacs:
https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout

https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/

My tests:

Shop Language LOCALECODE Shipping Country SHIPTOCOUNTRY Paypal Language Language DropDown Comments
Spanish es_ES Indonesia ID Bahasa Bahasa, English strtoupper disabled
Spanish ES Indonesia ID Bahasa Bahasa, English
English en_US Indonesia ID English Bahasa, English
English GB Indonesia ID English Bahasa, English
English GB Spain ES Spanish None
English US Spain ES Spanish None
English en_US Spain ES English None
English EN_US Spain ES English None strtoupper enabled
Spanish ES_ES Spain ES Spanish None
English EN_US Portugal PT English English, Español, Francais, Portugùes, Chinese
Spanish ES Portugal PT English English, Español, Francais, Portugùes, Chinese
Spanish ES_ES Portugal PT Spanish English, Español, Francais, Portugùes, Chinese
English en_US Germany DE English None
Spanish ES_ES Germany DE German None

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...