Home > Net >  How to Display custom user registration details in Account Details page in woocommerce
How to Display custom user registration details in Account Details page in woocommerce

Time:10-27

I added custom/extra user details in registration form of woocommerce (image attached - enter image description here

As per OP Request

you can get custom data using get_user_meta();

add_action( 'woocommerce_edit_account_form_start', 'add_my_custom_fileds_to_user_accound_detail_page', 10, 1 );
function add_my_custom_fileds_to_user_accound_detail_page(){
    $user = wp_get_current_user();
    ?>
    <p class="form-row form-row-wide">
        <label for="reg_dob"><?php _e( 'Date of Birth', 'woocommerce' ); ?><span class="required">*</span></label>
        <input type="text" class="input-text" name="reg_customer_dob" id="reg_customer_dob" value="<?php echo echo get_user_meta( $user->ID, 'customer_dob', true ); ?>" />
    </p>
    <?php
}
  • Related