• Resolved NF

    (@nanasflowers)


    Hi guys,

    When a social button is used at the Woocommerce checkout, it pre-fills the email field when this is set to be pulled.

    On my checkout page I have a confirm email field, as many people not using a social option enter their email address incorrectly.

    Is there any way you could make it so that the confirm email address field is also filled when a social option is used?

    Here is the code I have in my functions file for the confirm email field:

    add_filter( ‘woocommerce_checkout_fields’ , ‘bbloomer_add_email_verification_field_checkout’ );

    function bbloomer_add_email_verification_field_checkout( $fields ) {

    $fields[‘billing’][‘billing_email’][‘class’] = array(‘form-row-first’);

    $fields[‘billing’][‘billing_em_ver’] = array(
    ‘label’ => __(‘Confirm email address’, ‘bbloomer’),
    ‘required’ => true,
    ‘class’ => array(‘form-row-last’),
    ‘clear’ => true,
    ‘priority’ => 999,
    );

    return $fields;
    }

Viewing 1 replies (of 1 total)
  • Plugin Support Laszlo

    (@laszloszalvak)

    Hi @nanasflowers

    I an sorry, but we can not provide support for custom coding, but I have some suggestions that may help you in achieving your goals.
    First you should inspect your database and find the record that represents a users’s verified email address.
    E.g. if it is stored as a user meta in the <wp_preffix>usermeta table, then with the add_user_meta() or the update_user_meta() function of WordPress:

    your could set the proper value.

    You could hook this inside another function that you subscribe to our “nsl_register_new_user” action:

    which has the userID in its first parameter.

    Here is a basic example for the usage:

    <?php add_action('nsl_register_new_user', function ($user_id) {
        if (/* some logic if necessary */) {
            $user = new WP_User($user_id);
            add_user_meta($user->ID, 'the_meta_that_you_use', 'the_value_you_need_to_set');
        }
    });?>

    Best regards,
    Laszlo.

Viewing 1 replies (of 1 total)

The topic ‘Checkout Email Fill’ is closed to new replies.