Jump to content

Input type="tel" on phone and postal code fields (PS1.7.4)


DARKF3D3

Recommended Posts

  • 5 years later...
Posted (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 by DARKF3D3 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...