Forums

Redirect Plugin: set paypal language

benead 18 Jun, 2011
Hi there,

On a form that redirects to paypal using the redirect plugin, I would like to set the paypal page language to the one selected by the user on my site.

At the moment, the paypal page that opens is always in French.


Here's what I've done based on a chapter from this great book : http://greyhead.net/the-chronoforms-book

1 - A hidden field in the html form code:
<input type='hidden' name='lc' value='' />


2 - Under the General tab of the redirect plugin parameters page:
the 'lc' field set to lc

3 - Some bit of code in the extra code tab of the redirect plugin parameters page:
// get selected site language
$lang =& JFactory::getLanguage();

switch ($lang){
    case 'fr-FR':
       $lang = 'FR';
       break;
    case 'en-GB':
       $lang = 'EN';
       break;
    default:
       $lang = 'EN';
}

// set the language in the 'lc' field
JRequest::setVar('lc', $lang);


That doesn't work. I deleted my browser's cookies: wouldn't work. I also tried to simply put lc=EN in the 'Extra field values to send' under the General tab of the redirect plugin paremeters page but paypal would stick to its beloved French page.

Any ideas anyone?

Cheers, Ben
homefactor 19 Jun, 2011
This is a perfect tutorial. I always thought of putting a donation link through paypal. Now I think I know how to make it happen.
GreyHead 28 Jun, 2011
Hi benead,

Sorry, I missed this in my catch-up.

I Googled around a bit and it looks as though PayPal support for locale codes is limited (and patchy). I did find this thread which suggests that using http://www.paypal.fr in the target URL is the most likely way to force French but I'm not sure that http://www.paypal.com will force English.

Changing the country on the PayPal page changed the language - so it's possible that you could send this as e.g. country=FR

Bob
This topic is locked and no more replies can be posted.