1

I have a site entirely in English language about tourism in Italy. Now when the user clicks on "Paypal express check out" button finds the italian version of the Paypal Page.

I would like to force paypal to be in English language too, because if a customer speaking english language comes in Italy, he would like to have also paypal in the same language of the site and not based on his IP address, Browser Location, or anything else.

So, my question is: how can i be sure that all visitors see Paypal in the same language (English) of the rest of the site? I have Drupal 7 and Ubercart 3 installed.

I downloaded the Paypal SDK for PHP 5.2 and verified that it's enough to add

&LOCALECODE=en_UK

in the nvp string. Where do I have to modify Ubercart to integrate this update?

I tried to modify the uc_paypal.module adding

watchdog('paypal', "uc_paypal_ec_checkout",$variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL);

in all functions containing a $nvp_request array definition, but i can't see any new row in the watchdog table. Obviously i tried also to add a

'LOCALECODE' => 'en_UK',

row in the definition of the array, but with no effects.

I have the "Paypal express check out" button in the cart, and when i click on it, i obtain the italian version of the Paypal page.

If you have any idea about what file i have to modify and where, please help me.

If you need more info, let me know.

Thank you

user1014351
  • 437
  • 1
  • 5
  • 16

1 Answers1

2

I've recently been searching for a solution to this. Some mention being able to change the language of the actual Paypal account, although i've not managed to find that option hidden away with the paypal account setting pages. Plus it is useful for some to provide the payment pages in one language yet still have your account in your own language. So like you I was looking for exactly this.

I've looked through the uc_paypal module code and there doesn't seem to be any easy way to add to the SetExpressCheckout request neatly, so patching the code as you have done seems to be the only way.

The change you have made is the same as mine, except the locale code you are using isn't listed in the PayPal guide I have. I've been referencing the PayPal Express Checkout Advanced Features Guide.

If you use 'US' or 'UK' for your 'LOCALECODE' entry it should work for you. This has worked for me in Ubercart 3.0-rc3, and scanning the latest Ubercart code v3.1 it doesn't look like much has changed so this should work there too.

Note: there are 2 locations relating to the Paypal 'SetExpressCheckout' request which need to have the LOCALECODE added. (One in function uc_paypal_ec_checkout, and one in uc_paypal_ec_form_submit)

Hopefully that helps you.

I hate changing core code and really really really avoid doing it at all costs, and I don't agree with making these types of code changes, but it just wasn't possible on this occasion. If anyone has a better way to do this then please provide it. I think the real answer is to patch the Ubercart uc_paypal module to allow the LOCALECODE to be selected in the settings UI and then incorporate it into the SetExpressCheckout request. Not sure why it isn't currently in there, perhaps Paypal have added this feature after the module was written. I'll look into submitted a patch at some point if others haven't already, but if some one is better placed to make that change/patch then go right ahead! :) I just haven't yet fully familiarised myself with all the Drupal hoops to jump through for getting a patch submitted.

Pete Watts
  • 1,014
  • 10
  • 10