Automattic / Automattic/woocommerce-services

Full zip code validation at checkout

Open
#1,998 0 comments 0 reactions 0 assignees View on GitHub
[Pri] Low [Type] Enhancement woocommerce-services
Dominant language
JavaScript
Stars
112
Forks
31
Avg merge
3d 1h
Merged PRs (30d)
14

Description

## Problem
Currently, when checking out, WooCommerce Services does a quick zip code validation on the address that a customer enters.

![](https://d.pr/i/18bK1a+)
Image Link: https://d.pr/i/18bK1a

The problem is that it appears to only use the first two digits to validate. As a result, a customer can type in an invalid zip code and not receive a warning.

An example would be using the zip code `90000` for California state.

A real-world example would be a customer who entered `10093`, instead of `10993` for New York state.

## Suggestion
It would be great if the plugin did either full address validation or full zip validation at checkout to help prevent issues like this.

Of note, full validation is done when creating a shipping label.

2856324-zd

Contributor guide

Open the contributing guide

Research direction

Start at the checkout zip-code validation entry point and compare it with the full validation used when creating a shipping label. Reproduce the invalid examples 90000 for California and 10093 for New York; done means checkout rejects invalid full zip codes or performs full address validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
full-stack
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.