Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Download – Customizing Error Messages
Tagged: error, gettext formatting, message
- This topic has 18 replies, 8 voices, and was last updated 10 years, 4 months ago by StarCircleAcademy.
-
AuthorPosts
-
April 18, 2011 at 4:00 am #3202cherylMember
How do you customize how the following error is handled? Can you either change the wording or forward to different page???
Error! You have exceeded the maximum download limit for this link.
April 18, 2011 at 6:14 am #31450amin007ParticipantUsually the messages are customized via the language file but certain error messages are usually not to be seen by the customers so they are hardcoded in the plugin.
Please search for it in the “download.php” file and modify the text to whatever you like.
June 7, 2011 at 9:51 pm #31451dkbrainardMemberI’ve put multiple membership levels on my premium member download page to stagger content. Protections are working fine with one problem – early-stage members get an error message for hidden content for each month they haven’t yet attained. So first-month members will see their allowed content and then:
Hidden content is forbidden for this membership level.
Please Renew your account. Hidden content is forbidden for this membership level.
Please Renew your account. Hidden content is forbidden for this membership level.
Please Renew your account. Hidden content is forbidden for this membership level.
Please Renew your account.
etc.
I’ve successfully removed the “Hidden content is forbidden for this membership level” in the language file. How do I remove the Renew notification, which is inappropriate here?
Thanks
DK
June 8, 2011 at 2:50 am #31452amin007ParticipantThis thread refers to WP eStore but your post seems like it is related to WP eMember plugin. I am going to assume you mean WP eMember.
Search for the following in “wp_eMember1.php” file
return wp_emember_format_message ('<b>'. EMEMBER_HIDDEN_CONTENT_MESSAGE. '<br/>'.EMEMBER_PLEASE.' <a href=" '.$account_upgrade_url .'" target=_blank>'.EMEMBER_RENEW.'</a> '.EMEMBER_YOUR_ACCOUNT.'</b>');
Once you find it replace it with the following:
return "";
This will make it to where it does not show the warning to users who do not have the correct membership level to view a particular section protection.
June 8, 2011 at 5:06 pm #31453dkbrainardMemberYep you’re right – it is WP eMember. Thanks for the clear instructions. PROBLEM SOLVED
Thanks for a great plug-in with robust support.
DK
March 19, 2012 at 6:44 pm #31454Conrad FarlowMemberIs this still valid? I want to remove the ‘Please Renew or Upgrade your account.’ message as it is not relevant for me.
I cannot find
Code:return wp_emember_format_message (‘<b>’. EMEMBER_HIDDEN_CONTENT_MESSAGE. ‘
‘.EMEMBER_PLEASE.’ ‘.EMEMBER_RENEW.’ ‘.EMEMBER_YOUR_ACCOUNT.'</b>’);in wp_eMember1.php
Regards
Conrad
March 20, 2012 at 3:25 am #31455adminKeymasterThis functionality was moved to a different file. Check for the following line in the “emember_access_checkers.php” file:
return wp_emember_format_message (EMEMBER_HIDDEN_CONTENT_MESSAGE. '<br/>'.EMEMBER_PLEASE.' <a href=" '.$account_upgrade_url .'" target=_blank>'.EMEMBER_RENEW_OR_UPGRADE.'</a> '.EMEMBER_YOUR_ACCOUNT);
March 20, 2012 at 4:00 am #31456Conrad FarlowMemberThanks that worked perfectly. I have not removed it but modified the message.
May 15, 2012 at 6:54 pm #31457mkellamMemberHi,
I modified the download.php file in WP eStore to customize the error message and then customers started receiving a syntax error message. I believe that the problem is that I used an apostrophe for a contraction “We’re sorry” because when I viewed it in Taco, the text color changed at that point. I fixed that but I’d just like to confirm – the @ sign in the text of the error message (for an e-mail address) won’t cause a problem, right?
Thanks!
Michael
May 16, 2012 at 2:08 am #31458wzpModeratorGo for it! Of course, some browsers may decide to automagically turn the email address into a mailto link.
May 21, 2012 at 6:34 pm #31459mkellamMemberOK Thanks!
October 12, 2013 at 10:12 pm #31460StarCircleAcademyMemberI edited the download.php file and my edits were removed after an upgrade of eStore. I realize this is the way it should work, but is there a best practice for preserving my work? Perhaps the definitions for the text can be put in a separate, separately loadable file.
While I’m dreaming, perhaps the settings could allow a custom “contact URL” (which could be a page or mailto: link).
July 11, 2014 at 3:22 am #31461StarCircleAcademyMemberAs a follow up to my prior comment:
May I request an optional “USER_messages.php” file be included before the download.php (if it is found). That way I’d have a place where I could change the messages (by defining them) and theoretically not be affected by a store upgrade. My responsibility would only be to save and restore that one file, not have to re-add my changes to the newer download.php file. The download.php file would then only define those messages which do not already exist e.g.
defined(‘ESTORE_DLVS_HI1’) || define(‘ESTORE_DLVS_HI1’, ‘The secure download manager…
I am now behind several store bump ups because of the pain in re-making my changes to the message file(s).
A similar strategem could apply to other messages.
July 11, 2014 at 6:43 am #31462adminKeymasterWhat if we included those messages in the language file (just like the other messages)?
July 11, 2014 at 4:05 pm #31463StarCircleAcademyMemberAll in one place is better, but perhaps not enough because I’d still have to figure out which messages are new in the next release, that is, I wouldn’t be able to blindly overwrite the file without breaking some function.
E.g. suppose: version 7.0.3 has 6 msgs. Version 7.0.8 has 12.
I can’t re-use the file I customized from 7.0.3 or I will wipe out half of the defined messages in the new version. However if the message file is well ordered and documented I suppose it could be easier to keep up.
I wonder if you’ve thought about using gettext for I18N and L10N? Doesn’t solve the problem, of course, it’s just that it’s more flexible than using “define”.
http://codex.wordpress.org/I18n_for_WordPress_Developers
The last time I dealt seriously with this issue I was using Java resource bundles…
-
AuthorPosts
- You must be logged in to reply to this topic.