latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Custom Button on Paypal pro Form

Home Forums Community Forum Custom Button on Paypal pro Form

This topic contains 29 replies, has 5 voices. Last updated by  Cristián Lávaque 4 years ago.

Page 2 Of Topic Replies

Viewing 4 replies - 26 through 29 (of 29 total)
Author Replies
Author Replies
Posted: Thursday Jan 3rd, 2013 at 4:48 am #36086
Andaluzo
Username: andaluzo

Dear Christian,

I am aware that this is out of range of the Service Agreement and I really appreciate that you are helping with that.

As Jason already told, he sees also that this is a key feature and should be supported by the software, therefore I would be very thankful if we can solve that together and give the rest of the community the possibility to find a solution here.

The Output of

qtrans_getLanguage()

is

“de” “es” “en” depending on the language is selected.

Now I tried

<?php
add_filter('gettext_with_context', 'my_translator', 10, 4);
function my_translator($translated, $original, $context, $domain) {
	if ($domain === 's2member' && $original === 'en_US') {
		$lang_prv = qtrans_getLanguage();        
		if($lang_prv == 'de')
			$translated = 'de_DE'; 
		if($lang_prv == 'es')
			$translated = 'es_ES';
	}
	return 'de_DE';
}

But I still get

<input class="s2member-pro-paypal-submit s2member-pro-paypal-checkout-submit" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" id="s2member-pro-paypal-checkout-submit" value="Submit Form" tabindex="600" type="image">
Posted: Thursday Jan 3rd, 2013 at 4:58 am #36089

The Output of [hilite code]qtrans_getLanguage()[/hilite] is “de” “es” “en” depending on the language is selected.

I imagined that. What I meant was actually testing the output to confirm it is what you expect it to be, but you already found a problem with the other test.

[hilite code]return 'de_DE';[/hilite]
But I still get
/[hilite mono]en_US[/hilite]/i/btn/btn_xpressCheckout.gif

The problem right now is not in the code to select the language, the return is not afffecting the output, the function [hilite code]my_translator[/hilite] is not even firing, apparently.

What did you call the file where you have this hack we’ve been editing? Is it /wp-content/mu-plugins/s2-a.php as Jason indicated before? http://www.s2member.com/forums/topic/custom-button-on-paypal-pro-form/#post-35211

Did you try the hack exactly the way he posted it and had it work before you went editing more? It’d be good to have a working starting point.

Posted: Thursday Jan 3rd, 2013 at 5:18 am #36090
Andaluzo
Username: andaluzo

OK, lets start over .

File is called

wp-content/plugins/mu-plugins/s2-a.php

Its rights 664

the original code from Jason with the “de_DE”

<?php
add_filter('gettext_with_context', 'my_translator', 10, 4);
function my_translator($translated, $original, $context, $domain) {
    //if ($domain === 's2member' && $context === 's2member-front paypal-button-lang-code' && $original === 'en_US')
    if ($domain === 's2member' && $original === 'en_US')
       
	 $translated = 'de_DE';

	return $translated;
}

Still gives us the

<input id="s2member-pro-paypal-checkout-submit" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" class="s2member-pro-paypal-submit s2member-pro-paypal-checkout-submit" value="Submit Form" tabindex="600" type="image">
Posted: Saturday Jan 5th, 2013 at 6:12 am #36240

Thanks for confirming the filename.

Please try the conditions with just two equal signs instead of three, like this:

[hilite pre_code]
Viewing 4 replies - 26 through 29 (of 29 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.