PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Fixed payment language

s2Member Plugin. A Membership plugin for WordPress®.

Fixed payment language

Postby lucjager » March 23rd, 2011, 11:32 am

I would like to know if it possible to set an specific lange for the payment page in the S2members form.

Because a lot of people are getting the payment page in the wrong language. From the paypal support page they say:

"You can pass a variable in your button code called "lc" and "country" that will determine what language appears on the checkout page. If you want it to appear as English, you can pass "US" or "GB" as values. So you'll have:
<input type=hidden name=lc value=US>
<input type=hidden name=country value=US>

is this also possible for the s2members generated buttons / forms?

thanks

Luc
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed payment language

Postby Cristián Lávaque » March 23rd, 2011, 10:31 pm

For now, you'll have to use the Full Button Code, and then add the lc and country code variables documented here https://cms.paypal.com/us/cgi-bin/?cmd= ... 8A6HI0709B

The attribute for the shortcode has been added to the to-do list. Thanks for the great suggestion! :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby lucjager » March 24th, 2011, 3:56 am

Hi Cristian,

thank you for your reply,

I hope this will be integrated in the next version :-) for now is there a way around or is it possible to add a code to the template files? because I only need one country for all my buttons.

Thank you,

Best wishes,

Luc
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed payment language

Postby Cristián Lávaque » March 26th, 2011, 12:30 am

Well, you could try this. Create this file /wp-content/mu-plugins/s2-hacks.php with this code in it (no spaces before or after).

Code: Select all
<?php
add_filter
('ws_plugin__s2member_sc_paypal_button', 'add_lang_to_button');

function add_lang_to_button($button) {
    $button = str_replace('</form>', '<input type="hidden" name="lc" value="US" /> <input type="hidden" name="country" value="US" /> </form>', $button);
    return $button;
}
?>


This code is untested but should do the job for you. Please report back if you can. ;)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby lucjager » March 27th, 2011, 5:55 am

Hi Cristian,

i've uploaded your code, but the page still redirects me to the dutch paypall version...

here's the page: https://www.estss.org/lowrate/

hope you can help me,

thanks

Luc de Jager
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed payment language

Postby lucjager » March 30th, 2011, 3:50 pm

Hi administrator,

I made an mistake because i use the express checkout and these codes dont work with the express checkout, for the express checkout you have to use these codes:

LOCALECODE

For example to put it in fresh you have to add is like this:

[requiredSecurityParameters]&METHOD=SetExpressCheckout&AMT=10.00&
CURRENCYCODE=EUR&
RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html&
CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html
&LOCALECODE=fr_FR

is there anyway we can implent this in the templates?

source: https://www.paypalobjects.com/en_US/ebo ... ckout.html

I hope this can be done.

~ Luc
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed payment language

Postby Jason Caldwell » March 31st, 2011, 12:14 am

I'll see what we can do about this in the next release.

Until then, it sounds like you're running s2Member Pro with Express Checkout. So until this is possible with s2Member, you can modify the source code yourself, if you'd like. Check this file:
/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php.

You're looking for the section of code that contains.
$paypal["METHOD"] = "SetExpressCheckout";

Change it to:
Code: Select all
$paypal["METHOD"] = "SetExpressCheckout";
$paypal["LOCALECODE"] = "US"; /* Or whatever you need. */ 
Don't set CURRENCYCODE, that's already sent by the s2Member Pro module, based on your Pro Form Shortcode ( i.e. depending on the cc="US" attribute ).
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Fixed payment language

Postby lucjager » March 31st, 2011, 4:11 am

works perfectly!

thanks,

~ Luc
User avatar
lucjager
Experienced User
Experienced User
 
Posts: 33
Joined: November 10, 2010

Re: Fixed payment language

Postby TomRail » May 18th, 2011, 8:11 am

Hi there!

(first post- just wanted to say THANK YOU!! great plugin, great service, great forum people.. leanred a lot.. and most "problems" i found solutions very quickly)

I guess i have similar problem as the OP

S2member installed Version: 3.5.8
S2member pro installed Version: 1.5.8

but using just standard paypal checkout right now.
(except another image for the paypal button- just added the new button url to the shortcode)

I´m from Austria- website is in English language.
Whenever one is clicking on the buy button - he´s redirected to the paypal checkout screen. this works perfectly.

But the paypal form/checkout page.. is in German language.
Had changed my default backoffice language inside paypal account to English without success.
Also had a long call with an paypal rep.. he was talking about these "LOCALECODE" too.

tried the step above.. but apparently i didn´t found that phrase in the file:
paypal-checkout-in.inc.php



Is there any other way or solution to get the default paypal payment landing page language to English?


Thank you in advance!

Tom
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby Cristián Lávaque » May 18th, 2011, 11:42 am

Hi Tom. I'm glad you've found the help you needed in the forums so far, thanks for mentioning it!

I just checked the file and the line is there. Are you sure you checked the right file? Notice the -in part paypal-checkout-in.inc.php, there's another file named paypal-checkout.inc.php which isn't the one you want.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby TomRail » May 18th, 2011, 12:02 pm

Thank you Christian Cristián,

yes i had the right file (but checked the other too.. suggestion a mistake on your writing ;)

well i searched by hand.. found nothing.. then i used the "serach and replace" tool.. also nothing found.. even terms near to that.. hmmm..
are you still in the file? if so:
could you give me hint on the area.. or line where it should be?
(..or i will search again..)

Thanks a million!!!
Tom
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby Cristián Lávaque » May 18th, 2011, 12:40 pm

Line 87. Remember the LOCALECODE line is not there, that's what you'll add, you need to search for

Code: Select all
$paypal["METHOD"] = "SetExpressCheckout"
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby TomRail » May 18th, 2011, 12:49 pm

OMG!!

I need to ADD the line

$paypal["LOCALECODE"] = "US"; /* Or whatever you need. */

to get this result:

$paypal["METHOD"] = "SetExpressCheckout";
$paypal["LOCALECODE"] = "US"; /* Or whatever you need. */


Thank you!!!

Best regards,
Tom
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby TomRail » May 18th, 2011, 1:12 pm

if (! ($paypal = array ())) /* Build PayPal® Express Checkout request. */
{
$paypal["METHOD"] = "SetExpressCheckout";
$paypal["LOCALECODE"] = "GB"; /* Or whatever you need. */
/**/
$paypal["RETURNURL"] = $return_url; /* Return to this page. */


just checked.. payment site from paypal still in German. Is there maybe a different handling when having recurring payments setup?
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby Cristián Lávaque » May 18th, 2011, 1:36 pm

Try en_GB, see if that works.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby TomRail » May 18th, 2011, 2:54 pm

hmm that´s too bad.. en_GB also n ot worked.. maybe it´s something else
the EN - i had taken from the paypal site listing all their country codes.


Recap:

i use the following button code:
[s2Member-PayPal-Button level="1" ccaps="" desc="my membership description" ps="paypal" cc="EUR" ns="1" custom="www.xyz" ta="59.70" tp="1" tt="M" ra="39" rp="1" rt="M" rr="1" image="http://www.xyz.com/xyz.png" output="button" /]

the click on the button leads me to following URL:
https://www.paypal.com/cgi-bin/webscr


i saw that there many many other fields with
$paypal["METHOD"] = "

one for creating recurring subscriber profile
etc, etc

maybe i should fill in the "missing" line there too?
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby Cristián Lávaque » May 18th, 2011, 3:01 pm

I don't know why the LOCALECODE is not changing your PayPal interface. :|

I'll wait for Jason to see these replies and comment.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby TomRail » May 19th, 2011, 2:15 pm

found something interesting on exact that topic:

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECCustomizing#id0864A0Q60Y4

it says

....Changing the Locale

You can change the locale of PayPal pages to match the language on your website.

To change the language displayed on the PayPal pages, set the LOCALECODE parameter to one of the following allowable values in the SetExpressCheckout call:

...

ES - Spain

GB - United Kingdom
...

US - United States

The following example sets LOCALCODE to ES (Spain).

Request Parameters

[requiredSecurityParameters]
&METHOD=SetExpressCheckout
&RETURNURL=https://...
&CANCELURL=https://...
&PAYMENTREQUEST_0_AMT=10.00
&PAYMENTREQUEST_0_CURRENCYCODE=EUR
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&LOCALECODE=ES


Response Parameters

[successResponseFields]
&TOKEN=EC-17C76533PL706494P

The following figure shows the PayPal Login page when the LOCALECODE is set to ES.....



is maybe just the location where to insert the code snippet was slightly off?


Best regards,
Tom

P.S.: note at the picture on above webpage that the here generated form has a drop-down menue.. may for selecting other languages? .. i didn´t saw such at mine here.
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby TomRail » May 20th, 2011, 3:33 am

ok.. i´ll tried all again..

1- changed the LOCALECODE to "GB" in the paypal-checkout-in.inc.php

2- default language inside paypal account is English.. even on default payment template it shows all in English

3- generated a new recurring payment button

--> still German checkout page



Is it maybe cause of following?:
I used the shortcode.. but also watched the produced snippet.. i didn´t saw any of this added variable (GB).. may i´d need to input this into the snippet code too and avoid using the shortcode?


Code: Select all
####here´s the button snippet####

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
 <input type="hidden" name="business" value="myemail@domain.com" />
 <input type="hidden" name="cmd" value="_xclick-subscriptions" />
 <!-- Instant Payment Notification & Return Page Details -->
 <input type="hidden" name="notify_url" value="http://www.mydomain.com/?s2member_paypal_notify=1" />
 <input type="hidden" name="cancel_return" value="http://www.mydomain.com/" />
 <input type="hidden" name="return" value="http://www.mydomain.com/?s2member_paypal_return=1" />
 <input type="hidden" name="rm" value="2" />
 <!-- Configures All Of The Checkout Fields -->
 <input type="hidden" name="no_shipping" value="1" />
 <input type="hidden" name="no_note" value="1" />
 <input type="hidden" name="custom" value="www.mydomain.com" />
 <input type="hidden" name="currency_code" value="EUR" />
 <input type="hidden" name="page_style" value="paypal" />
 <input type="hidden" name="item_name" value="mydescription" />
 <input type="hidden" name="item_number" value="1" />
 <!-- Identifies/Updates An Existing Member After Checkout -->
 <input type="hidden" name="on0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?>" />
 <input type="hidden" name="os0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?>" />
 <input type="hidden" name="modify" value="0" />
 <!-- Customizes Prices, Payments & Billing Cycle -->
 <!--<input type="hidden" name="amount" value="39.00" />-->
 <input type="hidden" name="src" value="1" />
 <input type="hidden" name="sra" value="1" />
 <input type="hidden" name="a1" value="59.70" />
 <input type="hidden" name="p1" value="1" />
 <input type="hidden" name="t1" value="M" />
 <input type="hidden" name="a3" value="39.00" />
 <input type="hidden" name="p3" value="1" />
 <input type="hidden" name="t3" value="M" />
 <!-- Displays The PayPal® Image Button -->
 <input type="image" src="http://www.mydomain.com/myownimage.png" style="width:auto; height:auto; border:0;" alt="PayPal®" />
</form>
###snippet-end####
Last edited by Cristián Lávaque on May 20th, 2011, 11:28 am, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby Cristián Lávaque » May 20th, 2011, 12:13 pm

Hmm... Have you tried adding this to that code?

Code: Select all
<input type="hidden" name="LOCALECODE" value="GB" />


Also, could it have anything to do with a preference in your PayPal account? Or could it be a browser cache thing? Try another browser and purchasing without logging in to your PayPal.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby TomRail » May 20th, 2011, 3:04 pm

Thank you Cristián,

no i havent tried the code in the snippet as i´m using the generated shortcode.
i will try that.

Preference in paypal account is out of question.. already fixed any possible setting. Also paypal support doesn´t have any other idea of what setting to change except something in "my" code, means s2member calling the checkout page.

(ohh and yes i´m aware of caching thing.. it is not.. i wished it would be that simple :) )


Best,
Tom
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby Cristián Lávaque » May 20th, 2011, 3:19 pm

Well, you could show PayPal support the code for your button and ask them what there is wrong that would not change the language in their interface. :|
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby TomRail » May 20th, 2011, 3:34 pm

sure i´ll ask them..
may i´m wrong but from my understanding there´s nothing in the button code that would change the language...

and sorry it´s not a cache thing or logged-in-while-click-on-buying (happy it would be that easy :) .. also tested on diff browers in diff loactions by diff people...

may an silly question- would it matter in which line of the snippet code i place the
"<input type="hidden" name="LOCALECODE" value="GB" />"
?
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Re: Fixed payment language

Postby Cristián Lávaque » May 20th, 2011, 7:43 pm

No, it doesn't matter, as long as it's between the <form></form> tags.

So, what you're saying is that, although the code Jason suggested was added to the PHP file, it wasn't in the HTML the shortcode outputs?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Fixed payment language

Postby TomRail » May 21st, 2011, 2:34 am

yes exactly: added to php but does not appear in the shortcode/ code snippet output
User avatar
TomRail
Registered User
Registered User
 
Posts: 18
Joined: May 18, 2011

Next

Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron