Pergunta

Our client wants us to make the state field as an optional one in the Checkout. In order to do this, we have removed all the countries from the required state option and set to "Yes" for allowing to choose the state and make it an optional one through State option in Magento admin panel.

Now, we can see that the state field showing in the checkout but not as a mandatory field as per our client requirement. Here, we have a doubt, our client using an API to fetch the school address into the checkout. There, we can see that in some of the schools, the state field is showing as not mandatory but also there are schools which are omitting the state field.

how the state options work in Magento 2?

Could anyone please help me with this?

Foi útil?

Solução

Answer for your Question "how the state options work in Magento 2"

In many countries, the state, province, or region is a required part of a postal address. The information is used for shipping and billing information, to calculate tax rates, and so on. For countries where the state is not required, the field can be omitted entirely from the address, or included as an optional field.

Reference Magento User Guide

https://docs.magento.com/m2/2.1/ce/user_guide/stores/state-options.html

enter image description here

Allow to Choose State if It is Optional for Country

For countries where it is not required, determines if the Region/State field is included in the postal address of the customer. Options:

If Yes Includes the Region/State field in the customer address, even if not required by the country.

If No Omits the Region/State field from the customer address if not required by the country.

I hope this will help

Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top