Jump to content
Sign in to follow this  
benspun

PayPal Payment Page Automatic Language Selection contribution support

Recommended Posts

This is the support topic for "PayPal Payment Page Automatic Language Selection".

 

The contribution is available at:

 

 

 

=================================

 

DESCRIPTION:

 

This very simple modification allows the PayPal Payment page

to be displayed in the language selected by the customer on the shop.

It overrides the default language set up in your PayPal account.

 

This then permits a truly multilanguage integration of PayPal payments

into your online shop.

 

This works for the plain old PayPal payment module that comes by default

with osCommerce.

 

 

I had made this for my own needs, since I couldn't find any simple

contribution that did this. I am aware that there might be a better way

(codewise) to do this. Please feel free and encouraged to make such a

better or wiser way, and kindly let me know as well.

 

==================================

 

PROBLEM:

 

PayPal automaticaly displays the payment page in the language of your

PayPal account.

That causes problems if, for example, your PayPal account is in English

but your shop also has other language(s) than English. You would indeed

want the PayPal payment page to be displayed in the language your customer

selected in your shop!

 

 

SOLUTION:

 

PayPal accepts that you specify a "buyer's default country" for the payment

page, and will display the payment page on the language that corresponds to

this country.

 

Here you go!

So if you specify "Spain", the payment page will be in Spanish.

If you specify "France", the payment page will be in French.

If you specify "Germany", the payment page will be in German.

Etc.

 

You then only need to define a country for each of your language, and have

osCommerce send this info when the customer clicks "Confirm Order".

 

 

==================================

 

I will do my best to give help, if needed, about this very modest contribution.

 

Regards,

 

-Benoit

Share this post


Link to post
Share on other sites
Oups, I didn't put the link to the contribution! I do not have the access to edit my previous post, so:

The PayPal Payment Page Automatic Language Selection contribution is available at:

 

http://www.oscommerce.com/community/contributions,4701

 

Hi,

 

I use another paypal contribution : paypal IPN 0.981 and would like to use your hack for languages. Do you think you can integrate it on this version as well ?

 

Thanks


Outside links in signatures are not allowed!

Share this post


Link to post
Share on other sites
Hi,

 

I use another paypal contribution : paypal IPN 0.981 and would like to use your hack for languages. Do you think you can integrate it on this version as well ?

 

Thanks

 

Hi Tomcat,

 

No, unfortunately it would not work. I looked at the contribution you wrote about (paypal IPN 0.981) and the code of this is very different from the normal PayPal module.

 

But I located where you could probably modify it to suit your needs:

 

in /catalog/checkout_paypalipn.php, at line 253:

 

  tep_redirect("https://www.paypal.com/cgi-bin/webscr?cmd=_ext-enter&redirect_cmd=_xclick&business=".MODULE_PAYMENT_PAYPALIPN_ID."&item_name=".urlencode(STORE_NAME)."&item_number=".$insert_id."&currency_code=".$paypal_ipn_currency."&amount=".$paypal_ipn_order_amount."&shipping=".$paypal_ipn_shipping_amount."&tax=".$paypal_ipn_tax_amount."&first_name=".urlencode($order->customer['firstname'])."&last_name=".urlencode($order->customer['lastname'])."&address1=".urlencode($order->customer['street_address'])."&city=".urlencode($order->customer['city'])."&state=".urlencode($order->customer['state'])."&zip=".urlencode($order->customer['postcode'])."&email=".$order->customer['email_address']."&bn=oscommerce-osmosis-0.981&return=".tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')."&cancel_return=".tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')."&notify_url=".MODULE_PAYMENT_PAYPALIPN_NOTIFY_URL);

 

this is where the url is sent to PayPal.

So you would need to add this bit of code:

 

&lc=FR

 

to have the PayPal page displayed in French, for example.

 

The "&" always precedes some bit of information send to PayPal, so you just add here another bit of information, which is the default country for your buyer (and PayPal will display the payment page in the language of this country).

 

 

So you need to add something like this code:

 

&lc=".urlencode(COUNTRY_LANG)."

 

into the PayPal URL of your /catalog/checkout_paypalipn.php

 

Try replacing the line 253 with this line:

  tep_redirect("https://www.paypal.com/cgi-bin/webscr?cmd=_ext-enter&redirect_cmd=_xclick&business=".MODULE_PAYMENT_PAYPALIPN_ID."&item_name=".urlencode(STORE_NAME)."&lc=".urlencode(COUNTRY_LANG)."&item_number=".$insert_id."&currency_code=".$paypal_ipn_currency."&amount=".$paypal_ipn_order_amount."&shipping=".$paypal_ipn_shipping_amount."&tax=".$paypal_ipn_tax_amount."&first_name=".urlencode($order->customer['firstname'])."&last_name=".urlencode($order->customer['lastname'])."&address1=".urlencode($order->customer['street_address'])."&city=".urlencode($order->customer['city'])."&state=".urlencode($order->customer['state'])."&zip=".urlencode($order->customer['postcode'])."&email=".$order->customer['email_address']."&bn=oscommerce-osmosis-0.981&return=".tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')."&cancel_return=".tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')."&notify_url=".MODULE_PAYMENT_PAYPALIPN_NOTIFY_URL);

 

 

After, add this line:

  define('COUNTRY_LANG', 'US');  // The "ISO 3166-1 alpha-2" country code for a country that has *this* language as their main one, eg:  FR for France (French)

 

into your languages files, in:

/catalog/includes/languages/english/english.php and

/catalog/includes/languages/espanol/espagnol.php and

etc. (all your language files)

 

Indeed, you need to modify this last line according to the country which has the language you want. Here is "US", for displaying in English. Use "ES" for Spanish, "FR", for French, etc.

 

 

I haven't tested this (since I am not using this contribution) but it should work. If it doesn't, look carefully at the URL of the PayPal page to see where is the error.

 

I hope it can help. Tell me how it goes.

 

Regards,

 

-Ben

Share this post


Link to post
Share on other sites
This is a great submission! I use the PayPal contribution IPN Mdoule v1.0 For 2.2MS2.

 

I've tried my best, but I can't figure out where to put the code! Any and all help is appreciated!

 

K

 

Hi schlegk,

 

I had a quick look without finding the right place. I'm a bit busy at the moment, but I'll look at it closer later on, as I want to start using this module anyways, and I'll need to have the language selected automaticaly.

I'm not a MySQL expert, unfortunately, but I'm sure the solution must not be so complicated.

Well, I can conceive the solution easily, it then just need to be translated into code! :)

 

Regards,

 

-Ben

Share this post


Link to post
Share on other sites
This is a great submission! I use the PayPal contribution IPN Mdoule v1.0 For 2.2MS2.

 

I've tried my best, but I can't figure out where to put the code! Any and all help is appreciated!

 

K

 

Hi Karim,

 

I finally tried PayPal IPN module for myself, and I found out that it already is multi-languages since a few versions.

 

You'll find it here:

http://www.oscommerce.com/community/contributions,2679/

 

I highly recommend it, as it is very easy to install and very useful for a store owner.

 

Regards,

 

-Ben

Share this post


Link to post
Share on other sites

This is the support topic for "PayPal Payment Page Automatic Language Selection".

 

The contribution is available at:

 

 

 

=================================

 

DESCRIPTION:

 

This very simple modification allows the PayPal Payment page

to be displayed in the language selected by the customer on the shop.

It overrides the default language set up in your PayPal account.

 

This then permits a truly multilanguage integration of PayPal payments

into your online shop.

 

This works for the plain old PayPal payment module that comes by default

with osCommerce.

 

 

I had made this for my own needs, since I couldn't find any simple

contribution that did this. I am aware that there might be a better way

(codewise) to do this. Please feel free and encouraged to make such a

better or wiser way, and kindly let me know as well.

 

==================================

 

PROBLEM:

 

PayPal automaticaly displays the payment page in the language of your

PayPal account.

That causes problems if, for example, your PayPal account is in English

but your shop also has other language(s) than English. You would indeed

want the PayPal payment page to be displayed in the language your customer

selected in your shop!

 

 

SOLUTION:

 

PayPal accepts that you specify a "buyer's default country" for the payment

page, and will display the payment page on the language that corresponds to

this country.

 

Here you go!

So if you specify "Spain", the payment page will be in Spanish.

If you specify "France", the payment page will be in French.

If you specify "Germany", the payment page will be in German.

Etc.

 

You then only need to define a country for each of your language, and have

osCommerce send this info when the customer clicks "Confirm Order".

 

 

==================================

 

I will do my best to give help, if needed, about this very modest contribution.

 

Regards,

 

-Benoit

 

 

Oups, I didn't put the link to the contribution! I do not have the access to edit my previous post, so:

 

 

The PayPal Payment Page Automatic Language Selection contribution is available at:

 

http://www.oscommerc...tributions,4701

 

 

 

I visited that page, but there is no download link on it. How/where can I download this software?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×