Home / eCommerce / Donation Fee Radio Field
Duplicate Snippet

Embed Snippet on Your Site

Donation Fee Radio Field

adds option for them to cover fee, works with visual mode. disgusted their fee cover plugin only works on the ugly as heck non-customizable donation form

Code Preview
php
<?php
/**
 * 1. Register the Required Yes/No Radio Field
 */
add_action( 'init', function() {
    if ( ! class_exists( 'Charitable_Donation_Field' ) ) return;
    $field = new Charitable_Donation_Field( 'cover_fee_choice', array(
        'label' => __( 'Would you like your donation to cover third-party credit card processing fees?' ),
        'data_type' => 'meta',
        'donation_form' => array(
            'type'     => 'radio',
            'required' => true, 
            'options'  => array(
                'yes' => __( 'Yes, add the processing fee so the charity gets 100%' ),
                'no'  => __( 'No, I prefer not to' ),
            ),
            'show_after' => 'amount', 
        ),
        'admin_form'   => true,
        'show_in_meta' => true,
    ) );
    charitable()->donation_fields()->register_field( $field );
});

Comments

Add a Comment