• Resolved napsinbklyn

    (@napsinbklyn)


    Hi there,
    I am customizing a Give form through the filters in my functions file, and I have successfully made adjustments to some of the filter examples I have found, but I’m not sure what filters to use for some of the requested tweaks by my client.
    1. They have asked me to add some text below the payment selection row regarding paypal accounts. Is there a way to inject copy right below the payment selection field?
    2. Is there a filter to change the text for “offline donation” to “mail a check”?
    3. Also, it was requested of me to remove or adjust the “donation total” field at the bottom/top. Would it be possible to remove or adjust that field? I think they are finding it confusing, I am curious if there are any filter examples to tweak that part of the form.
    Thanks so much!

    https://www.ads-software.com/plugins/give/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Matt Cromwell

    (@webdevmattcrom)

    HI there,

    No problem.

    AFTER PAYMENT SELECTION ROW

    add_action('give_payment_mode_after_gateways_wrap', 'custom_after_payment_selection');
    
    function custom_after_payment_selection() {
    	echo '<p>This is custom text AFTER the payment selection row</p>';
    }

    OFFLINE DONATIONS LABEL

    add_filter('give_payment_gateways', 'custom_offline_label');
    
    function custom_offline_label($gateways) {
    	$gateways['offline'] = array(
    		'admin_label'    => 'Offline Donation',
    		'checkout_label' => __( 'Mail a Check', 'give' )
    	);
    
        return $gateways;
    }

    DONATION TOTAL
    Because the total is needed for processing and is stored and reused in many different areas it’s not suggested to remove it. Instead, I would just hide that via CSS, like so:

    p#give-final-total-wrap {
        display:none;
    }

    I’ll update our documentation with these samples. Thanks for your questions, keep us posted on how it goes!

    Thread Starter napsinbklyn

    (@napsinbklyn)

    Awesome! This is great, and thank you for getting back so quickly!
    I apologize for running this on one thread…is there any way to make the custom donation amount selection the default? Or, to make the $____ field at the top empty?
    Thanks!

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    The amount field will be empty if you choose “Set Donation” and enable the “Custom Amount” option. But for multi-level donations, we don’t have an out of the box way to make the Custom Amount the default. You’d have to do that with Javascript, like something like this example:

    https://stackoverflow.com/questions/9476617/how-to-set-radio-button-status-with-javascript

    Thanks!

    I want to rename OFFLINE DONATIONS LABEL on the user side?

    What file is it located in?

    Thanks

    I agree this should be a setting in the admin panel instead of a filter that developers.

    The file is located here:
    wp-content/plugins/give/includes/gateways/offline-donations.php

    But you shouldn’t modify the plugin files directly because if you upgrade it you’ll loose all the changes.
    You should modify the child theme like this:
    https://iandunn.name/the-right-way-to-customize-a-wordpress-plugin/

    In my instance, I found a file that is similar to functions.php in my child theme and added the filter code at the end and tested that worked.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Filter support’ is closed to new replies.