A customer can edit their details from Account Details (edit account) page, under My Account section of WooCommerce. Customer can edit their first name, last name, display name, email address and password from there. These fields are all required, when someone tries to edit. Our goal is to make the display name
not-required. We will use woocommerce_save_account_details_required_fields
filter to achieve this.
function careless_wc_account_details_required_fields( $required_fields ){
unset( $required_fields['account_display_name'] );
return $required_fields;
}
add_filter( 'woocommerce_save_account_details_required_fields', 'careless_wc_account_details_required_fields' );
Code goes in the functions.php
file of your active theme.