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.

How to edit JavaScript confirmation prompt?

Home Forums Community Forum How to edit JavaScript confirmation prompt?

This topic contains 7 replies, has 3 voices. Last updated by  Raam Dev 4 years, 6 months ago.

Topic Author Topic
Posted: Tuesday Jun 26th, 2012 at 6:28 pm #17593
John Potter
Username: johnp

My client feels the text in the file download JavaScript confirmation prompt is too “cute” for his business image, eg:

“so, no worries”

I can see how to suppress it altogether, but would prefer to edit it to something more appropriate.

Any clues on how to do this would be appreciated.

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Wednesday Jun 27th, 2012 at 8:09 am #17646
Raam Dev
Username: Raam
Staff Member

Hi John,

You should be able to change that in /includes/translations/s2member.pot. Open that file and search for “worries”.

Posted: Thursday Jun 28th, 2012 at 3:09 am #17727
John Potter
Username: johnp

I’ve found and deleted the text from s2member.pot , but it still appears in the pop-up.

There is no cacheing installed yet.

Posted: Friday Jun 29th, 2012 at 3:08 am #17824
Raam Dev
Username: Raam
Staff Member

Hi John,

Please see this thread and follow those instructions for modifying front-end messages. That should do the trick.

Posted: Sunday Jul 1st, 2012 at 1:35 am #18005
John Potter
Username: johnp

Thanks for the suggestion.

I’ve uploaded a plugin here: /wp-content/mu-plugins/s2-contextual-translation.php
with this code:

<?php
add_filter("gettext_with_context", "s2_contextual_translation", 10, 3);
function s2_contextual_translation($translation = NULL, $original = NULL, $context = NULL)
	{
		if($context === "s2member-front" && $original === "( so, no worries )")
			$translation = "";
		return $translation;
	}
?>

but the message is still there in the javascript prompt.

Posted: Sunday Jul 1st, 2012 at 9:06 pm #18045

Hi John.

You’ll need to work with the full string, not just the substring:

[hilite code]"You`re entitled to UNLIMITED downloads though ( so, no worries )."[/hilite]

I hope that helps. :)

Posted: Sunday Jul 1st, 2012 at 9:48 pm #18051
John Potter
Username: johnp

I appreciate the assistance guys. I’ve now got this in the plug-in:

<?php
add_filter("gettext_with_context", "s2_contextual_translation", 10, 3);
function s2_contextual_translation($translation = NULL, $original = NULL, $context = NULL)
	{
		if($context === "s2member-front" && $original === "You`re entitled to UNLIMITED downloads though ( so, no worries ).")
			$translation = "You`re entitled to UNLIMITED downloads.";
		return $translation;
	}
?>

But still no change :-(

Posted: Saturday Jul 7th, 2012 at 7:17 am #18547
Raam Dev
Username: Raam
Staff Member

I’m not sure why it’s not working, but I found where you can remove it manually: plugins/s2member/includes/s2member-min.js

You’ll want to make a backup of your changed file so that you can restore it after s2Member upgrades.

If you want to disable file download confirmations altogether, you can add this to your s2-hacks.php file:

<?php
add_action ("ws_plugin__s2member_before_sc_get_file","s2file_skip_confirmation_by_default");
function s2file_skip_confirmation_by_default($vars){
	if (!array_key_exists("skip_confirmation",$vars&#91;"attr"&#93;)) $vars&#91;"attr"&#93;&#91;"skip_confirmation"&#93;="yes";
}
?>
Viewing 7 replies - 1 through 7 (of 7 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.