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

    (@webdevmattcrom)

    Hi there,

    There are two options for adding custom fields to your donation forms:

    1) Code it based on our Documentation: https://givewp.com/documentation/developers/how-to-create-custom-form-fields/

    2) Or use our Form Field Manager: https://givewp.com/addons/form-field-manager/

    Thanks!

    Thread Starter cover2resources

    (@cover2resources)

    The documentation provides a good example of how to add what I need however I can’t get it to show up where I need to. The example shows that we will place it using the ‘give_after_donation_levels’ hook. However if I change this to something like ‘give_after_main_content’ or ‘give_after_terms’ as provided here: https://givewp.com/documentation/developers/actions-explanation-and-usage/

    then they don’t show up. I even made sure I enabled the content and terms section and typed in some words to make sure it was used. Even if I did get it to show up here I would really like to add it to the personal info section but I do not see a hook for that specific area. It there another documentation page I should be looking at?

    Thread Starter cover2resources

    (@cover2resources)

    After some messing around I was able to figure it out. For anyone looking to do this you need to use ‘give_purchase_form_after_personal_info’

    Also the example has the wrong coding structure compared to what the default First Name, Last Name, Email Address Field use. Specifically with the indicator and tooltip. These need to be placed inside the label and need to add ‘give-‘ in front of ‘icon’ and ‘icon-question’ classes.

    Ex:

    <p id="give-phone-wrap" class="form-row form-row-phone">
        <label class="give-label" for="give-phone"><?php _e( 'Phone Number:', 'give' ); ?>
            <span class="give-required-indicator">*</span>
            <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will use this to personalize your account experience.', 'give' ) ?>"></span>
        </label>
    
        <input id="give-phone" class="give-input required" name="give_phone" placeholder="Phone Number" value="" type="text"></input>
    </p>

    Plugin Contributor Matt Cromwell

    (@webdevmattcrom)

    I’m glad you got that worked out. And thanks for the updated markup, looks like that documentation wasn’t updated after our markup changed a bit.

    Thanks!

    I’d like to show comment field displaying people’s phone number box. I want to collect phone of commenters on my website and show it to myself in the backend for follow-up.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Phone Numbers and Comments’ is closed to new replies.