Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Not Specified" as a gender option when customer does not specify gender #1496

Merged
merged 4 commits into from
Sep 1, 2015

Conversation

chadbean
Copy link
Contributor

When creating a new customer in the Magento 2 admin, the gender field has only two options: Male or Female. This is not ideal as many times a customer won't specify their gender and there won't be any way to infer it. I propose adding a new option of 'Not Specified' for these cases.

@chadbean
Copy link
Contributor Author

Or, perhaps instead of setting a value for "Not Specified", the select box just has no value or a disabled value for "Not Specified" which is NULL.

@vpelipenko
Copy link
Contributor

@chadbean, these changes make sense and it is approved by product owner. But I think that it will change expected behavior a bit. 'Male' option has value '1' now and 'Female' is '2', but you want to change it and add 'Not Specified' with value 1. Probably it will confuse some extension developers. I suggest to add new option at the and of the list (with value '3'). What do you think?

@chadbean
Copy link
Contributor Author

I added "Not Specified" as value '1', assuming it would be a default value. I'm okay with making it a value of '3'. What about instead, we just update the front-end so it renders the drop-down with a "Not Specified" label that's disabled and shows first? Then, if the form gets saved without a value selected, the value should be NULL in the DB. Thoughts?

@vpelipenko vpelipenko self-assigned this Jul 22, 2015
@ilol
Copy link

ilol commented Jul 29, 2015

@chadbean we need to save backward compatibility with previous versions and can`t change codes of enumerators. Please take into account migration difficulties (although our Data Migration Tool is able to do this).

But you could always change sequence of drop-down items on UI.
Think, NULL has other meaning: really undefined value, "not specified" could have additional meaning like "third gender"

@vpelipenko
Copy link
Contributor

@chadbean, thank you last changes, but integration tests are failed after that. Looks like that you also should make changes in app/code/Magento/Customer/Setup/CustomerSetup.php. Are you going to fix it? After that we can accept this PR.

@chadbean
Copy link
Contributor Author

chadbean commented Aug 5, 2015

Thanks, I have made the change. For some reason, locally I am unable to see the additional option on the admin select combo. Is there a certain cache I should be clearing?

@vpelipenko
Copy link
Contributor

Hm, probably you need to reinstall Magento and new option will be added by CustomerSetup.php script.

@magento-team magento-team merged commit 6955679 into magento:develop Sep 1, 2015
vpelipenko added a commit that referenced this pull request Sep 1, 2015
vpelipenko added a commit that referenced this pull request Sep 1, 2015
magento-team pushed a commit that referenced this pull request Sep 17, 2017
[EngCom] Public Pull Requests
 - MAGETWO-75310 Fixed Typo Mistake in comment. #10905
 - MAGETWO-75309 Add escaping of js translation version #10904
 - MAGETWO-72341 enable universal use of modal and tab_group #10789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants