WordPress.org

Ready to get started?Download WordPress

Forums

PayPal Donations
User Defined Amount Hack (1 post)

  1. bamforp
    Member
    Posted 7 months ago #

    Hi Johan - nice plugin. Just wanted to share a hack I made to allow users to enter a custom amount if the 'amount' field is left empty. In paypal-button.php around line 20 I added an else statement. Might be worth considering for a future update as I notice a couple of folks have asked for something similar.

    regards

    Peter

    `if ($amount) {
    $paypal_btn .= '<input type="hidden" name="amount" value="' . apply_filters( 'paypal_donations_amount', $amount ) . '" />';
    } else {

    // Customised code added here ...
    $paypal_btn .= 'or enter an amount<br>';
    $paypal_btn .= '<input type="text" pattern="[\d\.]*" name="amount" value="' . apply_filters( 'paypal_donations_amount', $amount ) . '" /><br>';
    }`

    http://wordpress.org/plugins/paypal-donations/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.