D
D
DMax9212018-11-26 14:23:06
WooCommerce
DMax921, 2018-11-26 14:23:06

How to remove last name field in Woocommerce account?

Hello guys, tell me how to remove the Last Name field from the Woocommerce personal account
.
Please help, thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zeaovede, 2022-03-22
@zeaovede

1. Through functions, you need to make the fields optional

add_filter('woocommerce_save_account_details_required_fields', 'remove_required_fields');

function remove_required_fields( $required_fields ) {
    unset($required_fields['account_first_name']);
    unset($required_fields['account_last_name']);

    return $required_fields;
}

Ready.
2. Style disable margins

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question