Skip to content

Add autofill tokens to the checkout address and contact fields#92

Open
boo-code wants to merge 1 commit into
PrestaShop:mainfrom
boo-code:feat/address-autofill-tokens
Open

Add autofill tokens to the checkout address and contact fields#92
boo-code wants to merge 1 commit into
PrestaShop:mainfrom
boo-code:feat/address-autofill-tokens

Conversation

@boo-code

@boo-code boo-code commented Jul 5, 2026

Copy link
Copy Markdown
Contributor
Questions Answers
Description? The one-page checkout renders the delivery address, the invoice address and the guest contact e-mail without any autocomplete attribute, so browser autofill cannot reliably fill the checkout (measured on a default 9.2 + hummingbird install: 0 of the checkout fields carried an autofill token). This populates the standard WHATWG autofill tokens server-side in AddressFieldsFormatTrait (given-name, family-name, organization, address-line1, address-line2, address-level2, address-level1, postal-code, tel, country), scoped with the shipping / billing section keyword — the two address forms live on the same page, so the section keyword is what lets the browser fill the right form. The guest e-mail input gets autocomplete="email", and the module-owned country/state selects render the attribute from the field definition. Reducing checkout typing effort is a standard checkout-UX recommendation (Baymard Institute) and the tokens also satisfy WCAG 2.1 SC 1.3.5 (Identify Input Purpose, level AA). Notes: alias, vat_number and dni have no standard autofill token and stay untouched; the inline state select is rendered by the theme's form-fields.tpl select branch, which does not output autocomplete yet, so only the modal state select renders it for now (candidate follow-up in the theme).
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? vendor/bin/phpunit -c tests/php/phpunit.xml --filter AddressFieldsFormatTraitTest (19 tests green; full unit suite 212 tests green). On a 9.2 shop with the module enabled, open the one-page checkout and inspect the form: the delivery fields carry autocomplete="shipping ..." tokens, the invoice fields autocomplete="billing ...", the guest e-mail autocomplete="email". Browser autofill now offers to fill the address forms.

@ps-jarvis

Copy link
Copy Markdown
Collaborator

Hello @boo-code!

This is your first pull request on ps_onepagecheckout repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants