DARKF3D3 Posted October 27, 2018 Share Posted October 27, 2018 Hello, I would like to add type="tel" attributes on phone and postal code fields to show on smarphone numerik keyboard instead of the default one. Do you know how this can be done? Link to comment Share on other sites More sharing options...
DARKF3D3 Posted November 3, 2018 Author Share Posted November 3, 2018 (edited) EDIT Edited May 16, 2023 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
DARKF3D3 Posted May 21 Author Share Posted May 21 (edited) In case anyone is interested, this can be done on PS8.1 editing "/classes/formCustomerAddressFormatter.php" file. Around line 90 add: $formField->setType('tel'); foreach ($fields as $field) { $formField = new FormField(); $formField->setName($field); $fieldParts = explode(':', $field, 2); if (count($fieldParts) === 1) { if ($field === 'postcode') { $formField->setType('tel'); if ($this->country->need_zip_code) { $formField->setRequired(true); } } elseif ($field === 'phone') { $formField->setType('tel'); } elseif ($field === 'dni' && null !== $this->country) { if ($this->country->need_identification_number) { $formField->setRequired(true); } } Edited May 21 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now