WordPress.org

Support

Support » Plugins and Hacks » PayPal Donations » User Defined Amount Hack

User Defined Amount Hack

  • bamforp

    @bamforp

    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/

  • The topic ‘User Defined Amount Hack’ is closed to new replies.
Skip to toolbar