Jump to content

Paypal language


al_foto

Recommended Posts

My site is available in Spanish and english, Prestashop is 1.5.2 and Paypal module 3.4, my Paypal account is set to Spain.

 

Customers from other countries when selecting Paypal are redirected to Paypal in spanish, I need Paypal in their own country language or at least in english.

 

How can I change this ?

 

Please, it's a bit urgent because I'm loosing sales due to this problem, thanks.

Link to comment
Share on other sites

Solved ??

 

First I have updated to Paypal version 3.4.8

 

After a lot of hours and retries I have found that changing the file paypal_lib.php in the api subfolder of the module, where it says:

 

 

$params = array(
  'METHOD' => $methodName,
  'VERSION' => $method_version,
  'PWD' => Configuration::get('PAYPAL_API_PASSWORD'),
  'USER' => Configuration::get('PAYPAL_API_USER'),
  'SIGNATURE' => Configuration::get('PAYPAL_API_SIGNATURE')
 );

 

to

$params = array(
  'METHOD' => $methodName,
  'VERSION' => $method_version,
  'PWD' => Configuration::get('PAYPAL_API_PASSWORD'),
  'USER' => Configuration::get('PAYPAL_API_USER'),
  'SIGNATURE' => Configuration::get('PAYPAL_API_SIGNATURE'),
  'LOCALECODE' => 'en_US'
 );

it works and displays Paypal site in english, but even better: there is a small language selector at top right for english, spanish, french and chinese.

 

What worries me is that the address for the site is way shorter for the english version than the spanish, I can't test for the payment as I can't pay myself but hope it will work.

 

Most probably I can add a simple condition to test if language is spanish and in this case force LOCALECODE to 'es_ES'

 

Please let me know your thoughts, thanks

  • Like 1
Link to comment
Share on other sites

Ok, final version that seems to work fine is:

 

$thisLC = 'en_US';
if (class_exists('Context'))
$this->context = Context::getContext();
if( $this->context->language->iso_code == 'es' )
	 {
	  $thisLC = 'es_ES';
	 }
 // Making request string
 $method_version = (!empty($method_version)) ? $method_version : PAYPAL_API_VERSION;
 $params = array(
  'METHOD' => $methodName,
  'VERSION' => $method_version,
  'PWD' => Configuration::get('PAYPAL_API_PASSWORD'),
  'USER' => Configuration::get('PAYPAL_API_USER'),
  'SIGNATURE' => Configuration::get('PAYPAL_API_SIGNATURE'),
  'LOCALECODE' => $thisLC
 );

 

This way I have the Paypal site in the correct language depending on the language set in my shop, I only have 2 languages but should not be difficult to extend for some more.

 

May be Paypal has his own criteria for setting the language but at least I'm controlling that in the worst scenario the customer gets an english Paypal site. Have to test purchasing myself but should work ... I hope :)

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...