Support » Plugin: WooCommerce » remove first name and last name fields from billing address edit page only

  • Resolved Th10thpower

    (@th10thpower)


    Hi there,

    Please provide me the instructions of how to prevent users from changing their first name and last name.

    Right now, user can change their billing address including first name and last name. I would like to prevent that. users should only be able to see those two field when registering in checkout page and not be able to see that again.

    thank you

    https://wordpress.org/plugins/woocommerce/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mike Jolley

    (@mikejolley)

    Billing details are saved per order, so removing these fields is not advised.

    Are you just concerned with the first/last name on the user profile being changed?

    This can be disabled with this in functions.php of your theme:

    add_filter( 'woocommerce_checkout_update_customer_data', '__return_false' );

    Yes, I just want them be able to see what first and last name they have entered in registration without allowing them to change.

    users will be advised to contact our support team in case they wanna change those names.

    Plugin Author Mike Jolley

    (@mikejolley)

    ^ that should sort it then. This will prevent user being updated.

    Didn’t work, I can still change the details when logging as another user.

    Is that because the code will be applied to new registering users?

    Plugin Author Mike Jolley

    (@mikejolley)

    Didn’t work, I can still change the details when logging as another user.

    Just to stress, this prevents billing details (which can be changed) from updating the user itself. If you view the USER record, the name will never change.

    Oh yes I see. Thank you very much Mike.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘remove first name and last name fields from billing address edit page only’ is closed to new replies.