• Resolved spyniel

    (@spyniel)


    Hello,

    Could you guys help me to override the last_name class from require to not require in that field in user My account details?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi, @spyniel!

    You can use the following code to make that a non-required field:

    add_filter( 'woocommerce_save_account_details_required_fields' , 
    'smtl_edit_account_remove_required_names' );
      function smtl_edit_account_remove_required_names( $fields ) {
       unset($fields['account_last_name']);
       return $fields;
    }

    This code won’t, however, remove the asterisk. For that you’ll need to use CSS.

    Cheers!

    Hi @spyniel

    I just wanted to follow-up with you on this thread; hope you were able to achieve what you wanted by making the last_name class not required.

    I’m marking this thread as Resolved as we have not heard back from you in a while. If the problem persists though, feel free to reopen this, we would be happy to look into this for you.

    All the best!

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

The topic ‘form-edit-account.php’ is closed to new replies.