1 / 2
You are zero years old
Toby added an age check to the shop with the birthday box starting on today's date. The shop decided every customer was zero years old and sold nothing all day.
The mistake
The date-of-birth field is initialised to the current date instead of being left empty, so any customer who submits the form without editing it reports a birth date of today and the age check computes an age of zero, failing the over-18 gate for everyone. Changing the default to 1900-01-01 swaps one wrong default for another: now every unedited submission reports an age of 126, which clears the age gate but also trips the over-60s discount rule. The fix is to leave the field blank and require an explicit value, rather than pre-filling it with a date that is never true.
- ecommerce
- checkout
- frontend
- release
- ai-tooling