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

Changing between countries with states results in an error in the Checkout block #46270

Closed
opr opened this issue Apr 5, 2024 · 4 comments · Fixed by #47369
Closed

Changing between countries with states results in an error in the Checkout block #46270

opr opened this issue Apr 5, 2024 · 4 comments · Fixed by #47369
Assignees
Labels
block: checkout Issues related to the checkout block. focus: checkout Issues related to checkout page. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: bug The issue is a confirmed bug.

Comments

@opr
Copy link
Contributor

opr commented Apr 5, 2024

Issue description

When editing a saved address and switching between two countries with states, e.g. Japan and Hungary an error is shown in the address form.

The provided state (JP02) is not valid. Must be one of: BK, BE, BA, BZ, BU, CS, FE, GS, HB, HE, JN, KE, NO, PE, SO, SZ, TO, VA, VE, ZA
The provided postcode / ZIP is not valid

This shows that server-side validation is still happening against the old country.

Reproduction

  1. Disable local pickup (I had trouble reproducing with Local Pickup enabled)
  2. Be logged in. *
  3. Add an item to your cart and go to the Checkout block.
  4. Select Japan as your country. You may use this example address: 2 Chome-19-23 Aobadai, Meguro City, Tokyo 153-0042, Japan
  5. Place the order.
  6. Add another item to your cart and go to the Checkout block.
  7. On the saved address card, edit your address and go immediately to the Country field. Change it to Hungary.
  8. Observe the error.

1* This also works if you're logged out, you just have to fill a complete address then change country

Video

https://www.loom.com/share/5b8faeac82d241feab166862046501e4

Screenshot

Screenshot 2024-04-06 at 15 17 12
@opr opr added type: bug The issue is a confirmed bug. focus: checkout Issues related to checkout page. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues block: checkout Issues related to the checkout block. labels Apr 5, 2024
@nielslange
Copy link
Member

Thanks for reporting this issue, @opr. I was able to reproduce it and will move this issue to our backlog.

@wavvves
Copy link
Contributor

wavvves commented Apr 26, 2024

Shouldn't changing Country reset all the dependent fields? Is that what we're aiming at? What is the expected behaviour that a PR should contain? 🤔

@opr
Copy link
Contributor Author

opr commented May 7, 2024

I don't think it should reset anything, except the state, but only when state can be chosen from a discrete list of values.

@ralucaStan
Copy link
Contributor

a related internal chat p1715078726958079-slack-C8X6Q7XQU surfacing that for some countries we show the optional state fields in the shortcode, but not in the checkout.

this is not the reason for the bug, but having those states listed would enable shoppers to fix the notice;

If we do reset the state than we might not see the notice, so that could work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block: checkout Issues related to the checkout block. focus: checkout Issues related to checkout page. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants