custom customer attributes are wiped when updating email or password

Please replace the below code:

$numcte->setData('is_user_defined',1)->setData('is_required',0)->setData('default_value','')->setData('used_in_forms', ['adminhtml_customer', 'checkout_register', 'customer_account_create', 'customer_account_edit', 'adminhtml_checkout']);

With this one:

$numcte->setData('is_user_defined',1)->setData('is_required',0)->setData('default_value','')->setData('used_in_forms', ['adminhtml_customer']);

And then try to create the attribute. For re-create please first remove the module entry from the setup_module table and then run the upgrade command.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top