commerce.js icon indicating copy to clipboard operation
commerce.js copied to clipboard

Auto-select county/state field when a postal/zip code is entered that is recognised

Open robbieaverill opened this issue 2 years ago • 0 comments

Sceario: in a checkout form you've selected United States as your country, and you start typing 94107 into the ZIP code field. It would be cool if the form could auto-select California as the state from the dropdown.

There are a number of things that would be required of Commerce.js to make this happen:

  • Awareness of state, in an abstracted way that doesn't depend on any specific frameworks
    • An alternative might be to fire events instead of updating state when a state can be resolved. It would be up to the developer to subscribe to these events and connect to their state.
  • Awareness of US postal codes, although this could be fetched asynchronously from the Chec API.

robbieaverill avatar Sep 23 '21 00:09 robbieaverill