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

State/Province field doesn't show as required on the add new address page. #5279

Closed
dcabrejas opened this issue Jun 27, 2016 · 15 comments
Closed
Labels
bug report Component: Customer Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@dcabrejas
Copy link

dcabrejas commented Jun 27, 2016

Steps to reproduce

  1. Install Magento 2 ee/ce through composer.
  2. Set the default Locale as English (United Kingdom) in the backend at Stores > Setting Configuration > General > General > Locale Options > Locale.
  3. Set State as required for the United Kingdom in the backend at Stores > Setting Configuration > General > General > Country Options > State Options > State is Required for.
  4. Create an account in the front-end.
  5. Navigate to My Account > Address Book > Add new address.
  6. Don't fill any fields, just make sure that the country selected in United Kingdom.
  7. Click the save Address Button

Expected result

  1. After selecting the United Kingdom as the country, I'd expect a red star to be added next to the State/Province label as this is a required field for the UK.
  2. After clicking the Save address button, the validation for the State/Province field would fail with a message stating : This is a required field. This is happening.

Actual result

  1. After selecting the UK as the country, the red star is not added next to the label of the state/province filed to indicate that the field is required for the UK. However when you try to save the address without having filled out the state/province field, the validation fails, letting you know that the field is required.

Observations
I have observed that this behaviour only happens when there is no values for the UK state/provinces in the database. This works for the US, I think because the US has predefined states stored in the database and when you select the US as the country, Magento changes the State/Province filed to be a select field and adds the red star next to its label.

Screenshots

  1. Working for the US, the red star is placed next to the State/Province label indicating its a required field
    screen shot 2016-06-27 at 10 01 27

2.Upon changing the country to the UK, the red star disappears, indicating the State/Province field is optional.
screen shot 2016-06-27 at 10 01 39

  1. However if we try to save the address without having filled out the State/Province field, the validation for this field doesn't pass as this is configured to be a required field for the UK.
    screen shot 2016-06-27 at 10 01 45
@antboiko
Copy link

Hi @dcabrejasazagra , thanks for reporting this issue. I've created internal ticket MAGETWO-54785.

Thanks,
Anton.

@antboiko antboiko added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development CS bug report labels Jun 27, 2016
@vkorotun vkorotun removed the CS label Aug 4, 2016
mmansoor-magento pushed a commit that referenced this issue Aug 26, 2016
… on the add new address page. #5279

- fixing logic for mandatory labels and error cleanup when switching countries and updating region
mmansoor-magento pushed a commit that referenced this issue Aug 26, 2016
…ETWO-54785-State-province-not-required-mainline

[Fearless kiwis] MAGETWO-54785: [GitHub] State/Province field doesn't show as required on the add new address page. #5279
@brideo
Copy link
Contributor

brideo commented Sep 21, 2016

+1 is there a work around for this for the time being?

@PiscesThankIT
Copy link

PiscesThankIT commented Oct 13, 2016

General > Country Options > State Options > Allow to Choose State if It is Optional for Country
It doesn't work too.

okorshenko pushed a commit that referenced this issue Dec 14, 2016
…required on the add new address page. #5279

- applying changes from MAGETWO-54785 to 2.1
okorshenko pushed a commit that referenced this issue Dec 14, 2016
…ETWO-56962-State-province-not-required-2.1

Fixed issue:
 - MAGETWO-56962: CLONE - [GitHub] State/Province field doesn't show as required on the add new address page. #5279
@elenleonova
Copy link

This issue has been delivered to 2.1.3, 2.0.10 as well as 2.2.0

@teokolo
Copy link

teokolo commented Feb 16, 2017

Magento 2.1.4 (updated from 2.0.8), problem still present.

Steps to reproduce:

  1. Set "Default Country": Italy
  2. Set "State is Required for": Italy
  3. Add products to cart
  4. Go to checkout (checkout only for registered users)
  5. Click on CREATE ACCOUNT, fill required fields
  6. Go on with checkout: State/Province field is not required

Screenshot
province-bug

If you go on without filling state/province, it's impossible to complete the order:
7. fill required fields, leaving state/province empty
8. choose payment method (bank payment in my case)
9. place order: "An error occurred on the server. Please try to place the order again."

Screenshot
province-bug-2
Error message is the same of this one: #6929

If I go back to shipping details and I fill state/province field (which is not required) and I go on, order can be completed.

I need an urgent workaround because my customer website is stuck. Setting state/province as required seems enough to solve this bug.

@davideghz
Copy link

davideghz commented Mar 29, 2017

same problem here on Mage 2.1.2 - pretty urgent as well.

adding 'required' property to field using jQuery does not work..
$("[name='region']").prop("required", true);

@kjasrotia
Copy link

kjasrotia commented Mar 31, 2017

Yeah same problem here with my e-commerce store in Magneto 2.1.4 (fresh install)

I have specified "State" field as mandatory for my Country, but during checkout the customer is able to add address without the State as it is not shown as required in the address form (however, when customer has registered account and goes to add a new address from account settings, then 'State' is shown as required - go figure !!)

During checkout it gives an "Error occurred on the server" error. When the State is provided in address the checkout goes thru.

This basic issue needs to be fixed ASAP .. losing sales because of this ! Customer obviously does not know issue and abandons the transaction. Why is specifying "State" as mandatory not making it a required field in ALL the various address forms for customers Magento ??

@rab14191
Copy link

still faceing same problm in magento 2.1.7 this error should solvee :/

@justanewbie00
Copy link

Facing the same problem in 2.1.6 version. Error whenever the payment method is paypal.

@vphat28
Copy link

vphat28 commented Aug 17, 2017

i'm faceing this issue also :(

@rab14191
Copy link

@vphat28 you can add this modul into ur site and add your state name then will be solve your problm
https://github.com/php-cuong/magento2-regions-manager

@ifeltsweet
Copy link

Still in 2.1.8....

@syntheticlab
Copy link

HI, facing same problem: on some 2.1.7 installations.

Any suggestions on how to overcome?

thanks everyone

@nroomaney
Copy link

I'm having the same issue when selecting UK as the country.
I'm using Magento version 2.2.2

@makwanamahesh-code
Copy link

i'm faceing this issue also :(. any one have solution pls helps us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Customer Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests