WordPress.org

Ready to get started?Download WordPress

Forums

Donate Plus
Minimum Donations (6 posts)

  1. trizzant
    Member
    Posted 2 years ago #

    I am looking for a way to limit the minimum donation amount. I tested a few .01 donations and it worked. The problem is that people may leave meaningless donations just to post comments. Without going into too much detail I have competition who can be very malicious. Multiple .01 donation would keep me busy removing comments and possibly suspend my account if combined with Paypal disputes.

    So I was thinking that the amount box in the donation form could be made to only accept values greater than X. X being $10 or whatever I decide on. Could this be a line I could add to the php. I am not a programmer but I can modify code if shown the right way. Any help is much appreciated, Thanks.

    http://wordpress.org/extend/plugins/donate-plus/

  2. trizzant
    Member
    Posted 2 years ago #

    Paid a dev on Freelancer to do it. Here you go.

    Changes should be in donate-plus.php <--

    <span id="errd"></span>

    ^ That next to the amount input field tag
    ------------

    <script type='text/javascript'>
    jQuery('#donateplusform').submit(function() {

    if (jQuery('#amount').val() >= ".$dplus['default_value'].")
    {
    return true;
    }
    jQuery('#errd').css('color', 'red');
    jQuery('#errd').text('Error: $".$dplus['default_value']." Minimum ').show();

    return false;
    });
    </script>

    ^ That just below the donation form...

  3. adalsanto
    Member
    Posted 2 years ago #

    Thank you for sharing it.

    I have made the suggested changes and now the donate-plus-php looks like the following:
    [Code moderated as per the Forum Rules. Please use the pastebin]

    But the page doesn't load (error).. Can anyone tell me where I have made the mistake?

    (I don't know anything about PHP..)

    Thank you in advance

  4. adalsanto
    Member
    Posted 2 years ago #

    Sorry, I didn't know the Forum Rules on pasting code.

    To see code click here: http://pastebin.com/th8si17P

    Thank you

  5. adalsanto
    Member
    Posted 2 years ago #

    Hi Trizzant, I have followed your instructions but I was not able to make donate-plus work. Could you please tell me after which line of code your code is put in donate-plus.php? Thank you. Andreas

  6. adalsanto
    Member
    Posted 2 years ago #

    I have studied PHP in the meantime and I have got the answer myself.

    You should add the '<span>xxxx</span>' code above in donation-plus.php to:

    '<small>('.__('Currency: ','dplus').$cur.')<span id="errd"></span></small></p>';'

    And add between 'endif;' and 'return $output;' the following code:

    '$output.="--copy here code--";'

    Where --copy code here-- is the code listed above.

    I am surprised an indian freelance expert asked me $100 to do this trick, I am proud that I have saved money while learning a whole lot of PHP!! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic