Form fields accept international addresses
Why it matters
Hardcoding "State" and a 5-digit ZIP regex locks out every customer outside the United States. A Canadian shopper entering K1A 0B1 hits a validation error on a valid postal code; a British shopper doesn't recognize "State" as the field for their county. Both abandon. If the country selector offers fifteen countries but the form never adapts to them, you're advertising international shipping and then blocking it at the form layer — a worse failure than not offering the countries at all.
Severity rationale
Low in aggregate because most stores are US-first, but the block is total for every non-US shopper who reaches it.
Remediation
Drive address labels and validation from a country-keyed table in src/lib/addressFormats.ts, and re-render the form in src/components/AddressForm.tsx when the country changes. Swap "State" to "Province" for CA, "County" for GB, and swap the postal regex accordingly.
const ADDRESS_FORMATS = {
US: { labels: { region: 'State', postal: 'ZIP' }, postalPattern: /^\d{5}(-\d{4})?$/ },
CA: { labels: { region: 'Province', postal: 'Postal Code' }, postalPattern: /^[A-Z]\d[A-Z]\s?\d[A-Z]\d$/ },
}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Cart & Checkout UX Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-cart-ux·automated