Support » Plugin: PayPal Donations » User Defined Amount Hack

  • 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.



    `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>’;

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