During plugin install gender custom field is added to be used when needed. This actually has nothing to do with Storefront view, they are totally independed from each other. This custom field is actually for administraion purposes as in:
When admin wants to add new customer, this will be used
When admin wants to view existing customer who registered themselves, their chosen option will be seen to admin in a proper way and admin will be able to edit it.
Basically, custom field is for only admin. Only requirement is that, their keys should be same. It is better_payment_customer_gender in our case.
When plugin config changes any of collect birthday flags, birthday field is activated (and added to register page) from system config but not set as required.
When plugin config changes any of collect gender flags, gender select box is added to register page by plugin extending register view. When added gender is always required.
When customer selects Private as account type, depending on whether plugin config enabled birthday and/or gender collection, JS on extended register page makes these fields required in the form.
When customer selects Commercial as account type, depending on whether plugin config enabled birthday and/or gender collection, JS on extended register page totally removes these fields from the form.
Implemented as discussed in related issue. So,
Basically, custom field is for only admin. Only requirement is that, their keys should be same. It is
better_payment_customer_gender
in our case.Private
as account type, depending on whether plugin config enabled birthday and/or gender collection, JS on extended register page makes these fields required in the form.Commercial
as account type, depending on whether plugin config enabled birthday and/or gender collection, JS on extended register page totally removes these fields from the form.