Change fundraiser paypal express donation text and send button action

Hi two questions,

1) We have gotten complaints that the way the fundraiser works to sign-up for a fundraiser reward level is confusing. When you click a reward amount you then have to click the fund this or what ever the button says to be taken to the paypal checkout page. What is the best way to change this so when someone clicks a reward level they are taken directly to the paypal checkout page?

We considered using javascript with a click function but we are using upfront and are not sure of the best way to do this in this theme. We are not sure if we can just add an line to the theme javascript file as we are not sure if it would break the theme and it would surely be over written after an update. We thought about adding a html element and then adding the javascript that way but we are running into a max send limit with wp-admin.ajax and can not add any more elements to the page we would like to do this with. So what would be the best step?

2)The paypal express page payment button has a donate now text. From our reading and speaking with payal this is coming from the plugin. What is the best way to change this?

Thanks for your help.

  • Rupok

    Hi Bryant

    Hope you had a wonderful day.

    We considered using javascript with a click function but we are using upfront and are not sure of the best way to do this in this theme

    You can do this by creating a MU Plugin. For creating a mu plugin, create a folder named "mu-plugins" inside your "wp-content" folder. Then inside that "mu-plugins" folder, create a file with any name and with a .php extension. Now paste the code inside that file and save.

    <?php
    add_action( 'wp_footer', 'show_checkout_button' );
    function show_checkout_button() {
        ?>
        <script type="text/javascript">
           // Your JS Code Here
        </script>
        <?php
    }

    Replace "// Your JS Code Here" with your actual JS code.

    For getting more idea on mu plugins, you can go through this article: https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    What is the best way to change this?

    Can you please give us a screenshot of the button we are talking about? It will help us to understand this better and provide solution faster.

    I'm looking forward to hear from you and resolve this issue as soon as possible.

    Have a nice day. Cheers!

  • Bryant

    Sorry for the late response. I did not see your response come into my email. It's usually marked important to insure that I see it but did not this time. My apologizes apologies

    Thats for your input of creating a plugin. What we actually did was set the element that contains the fundraiser panel to a global region and than on another page that is not reaching the 1mb limit we are facing added the code element and the javascript code. It work perfectly.

    The only thing we have left is changing the text on the paypal express page from donate to order. Paypal said that this is coming from the fundraiser plugin not them.

    P.S.
    Would you happen to now of any updates on any other payment gateway for fundraiser plugin. Using Paypal api is horrible. We have been answering questions and waiting for api access for a few days shy of a month mow.

  • Nithin

    Hi Bryant,

    Hope you are doing good today. :slight_smile:

    The only thing we have left is changing the text on the paypal express page from donate to order. Paypal said that this is coming from the fundraiser plugin not them.

    I couldn't see the donate button text in your screenshot, maybe I'm missing something. But I guess this is what you are looking for:

    function fundraising_change_text( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'Donate Now' :
    			$translated_text = __( 'Order Now', 'wdf' );
    			break;
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'fundraising_change_text', 20, 3 );

    I think you already have a file in mu-plugins/ please add this code to that file as directed above, please let me know if I'm missing anything.

    Have a nice weekend. :slight_smile:

    Kind Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.