johanmeer Posted November 16, 2020 Share Posted November 16, 2020 Hi, i'm from the Netherlands. It happens 20 times a day that customers forget to fill in the complete address like this: 'Hoofdstraat 121', instead they fill in: 'Hoofdstraat'. Is there a way to get the address field validated on a minimum of 1 digit in the Address field? Link to comment Share on other sites More sharing options...
johanmeer Posted November 22, 2020 Author Share Posted November 22, 2020 Is it maybe in this part? public static function isAddress($address) { return empty($address) || preg_match(Tools::cleanNonUnicodeSupport('/^[^!<>?=+@{}_$%]*$/u'), $address); } Link to comment Share on other sites More sharing options...
rrataj Posted November 22, 2020 Share Posted November 22, 2020 Yes, Could you try to change it to: public static function isAddress($address) { return empty($address) || preg_match(Tools::cleanNonUnicodeSupport('/(?=^[^!<>?=+@{}_$%]*$)(?=.*[0-9].*$)/u'), $address); } Link to comment Share on other sites More sharing options...
freelex Posted July 28, 2021 Share Posted July 28, 2021 Guys which file are you editing? Link to comment Share on other sites More sharing options...
rrataj Posted July 28, 2021 Share Posted July 28, 2021 It's /classes/Validate.php. But the best would be to override this class in /override/classes/Validate.php 1 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