Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

WP eStore Download – Customizing Error Messages

by

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 8 years, 8 months ago by StarCircleAcademy.
Viewing 15 posts - 1 through 15 (of 19 total)
1 2 →
  • Author
    Posts
  • April 18, 2011 at 4:00 am #3202
    cheryl
    Member

    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 #31450
    amin007
    Participant

    Usually 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 #31451
    dkbrainard
    Member

    I’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 #31452
    amin007
    Participant

    This 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 #31453
    dkbrainard
    Member

    Yep 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 #31454
    Conrad Farlow
    Member

    Is 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 #31455
    admin
    Keymaster

    This 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 #31456
    Conrad Farlow
    Member

    Thanks that worked perfectly. I have not removed it but modified the message.

    May 15, 2012 at 6:54 pm #31457
    mkellam
    Member

    Hi,

    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 #31458
    wzp
    Moderator

    Go 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 #31459
    mkellam
    Member

    OK Thanks!

    October 12, 2013 at 10:12 pm #31460
    StarCircleAcademy
    Member

    I 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 #31461
    StarCircleAcademy
    Member

    As 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 #31462
    admin
    Keymaster

    What if we included those messages in the language file (just like the other messages)?

    July 11, 2014 at 4:05 pm #31463
    StarCircleAcademy
    Member

    All 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…

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 19 total)
1 2 →
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ