WordPress.org

Forums

PayPal Donations
[resolved] More Options? (7 posts)

  1. GvnrRickPerry
    Member
    Posted 2 years ago #

    Hey,
    I wanted to say I really like the plugin, but I'm not sure if I'm using it right. I would like to basically have the "Purpose" and "Reference" options available to the "donator" to fill in.
    I've went through the configuration a couple of times, but can't find anything that puts text boxes in the Widget on the home page.
    Any ideas?
    Thanks!
    -Duane
    (http://www.ak907.net)

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

  2. Johan Steen
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi,

    The plugin those not expose those parameters on the frontend. The plugin does allow that behavior to be overriden using a filter though. The purpose is exposed to allow for a change on the frontend. You can hook into that filter and change it to a text box for instance.

    paypal_donations_purpose_html

    I'll probably add more filters in a future version, but in the current version, using the purpose filter, should get you close to your need anyway.

    Cheers,
    Johan

  3. Johan Steen
    Member
    Plugin Contributor

    Posted 2 years ago #

    Let me know if you have any problems implementing a filter, and I can give you some example code.

    I try to avoid to expose to many of the optional/specialized parameters in the GUI, to keep the plugin as simple to use as possible.

  4. GvnrRickPerry
    Member
    Posted 2 years ago #

    I have no idea about any of this but am pretty keen on figuring coding out. I will give it a shot, and in the interim if you see this and have a chance, could you post an example so I can take a look and compare what I've got?
    Thank you,
    -GvnrRickPerry (Duane)

  5. Johan Steen
    Member
    Plugin Contributor

    Posted 2 years ago #

    This might help you get going, place it in your theme's function.php file.

    add_filter( 'paypal_donations_purpose_html', 'display_paypal_purpose' );
    
    function display_paypal_purpose( $field )
    {
    	$field = str_replace( 'hidden', 'text', $field );
    	$field = '<label for="item_name">Purpose:</label>'.$field;
    	return $field;
    }

    Cheers,
    Johan

  6. GvnrRickPerry
    Member
    Posted 2 years ago #

    Johan,
    You are the bomb! All I did was add the above code to the function.php file and wallah! It gives me exactly what I need!

    Honestly, I didn't expect anyone to be so helpful with the question I had proposed, but you have really gone above and beyond with the code you provided!

    I will admin, it's not the *best* looking as far as formatting goes, but I'm so afraid I'm going to mess something up if I go in and try to fix the formatting that I'm not going to touch it.

    I really do appreciate you providing that code and answering my questions. You are truly an asset to this community. If there's anything I could ever do for you, please just let me know!
    Thank you again!
    -GvnrRickPerry (Duane)

  7. leoly
    Member
    Posted 2 years ago #

    Is there a way to also add the reference to the front end?

    thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • PayPal Donations
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.