Add autofill tokens to the checkout address and contact fields#92
Open
boo-code wants to merge 1 commit into
Open
Add autofill tokens to the checkout address and contact fields#92boo-code wants to merge 1 commit into
boo-code wants to merge 1 commit into
Conversation
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
autocompleteattribute, 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 inAddressFieldsFormatTrait(given-name,family-name,organization,address-line1,address-line2,address-level2,address-level1,postal-code,tel,country), scoped with theshipping/billingsection 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 getsautocomplete="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_numberanddnihave no standard autofill token and stay untouched; the inline state select is rendered by the theme'sform-fields.tplselect branch, which does not outputautocompleteyet, so only the modal state select renders it for now (candidate follow-up in the theme).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 carryautocomplete="shipping ..."tokens, the invoice fieldsautocomplete="billing ...", the guest e-mailautocomplete="email". Browser autofill now offers to fill the address forms.