netline Posted August 9, 2011 Share Posted August 9, 2011 Hi all, I'm facing a problem with one of my client's eBusiness website. For now osCommerce is used, but we wanna use prestashop. I tried the osCommerce import module of prestashop but I can't find solution to my problem. My client's customers are companies for most of them. In osCommerce, lastname where use for the companies names. But in some of companies name there's some special char as numbers, "+" etc... How can I allow these chars in prestashop? As a company doesn't have a date of birth, how can I disable it? I'm facing an other more specific problem. One customer have an email with a "+" in the domain (xxxxxx@xxxx+.xx), I khow it's not following standards, but I can't tell the company to change all their emails... Prestashop tells me the email is invalid and I can't import the customer. How can I make prestashop allow this email address? Thanks in advance for helping me. Link to comment Share on other sites More sharing options...
Paul C Posted August 9, 2011 Share Posted August 9, 2011 Assuming that you're using version 1.4.x.x You could override the functions in the Validate class. In the override/classes folder create a file called Validate.php containing: class Validate extends ValidateCore { } Then you can copy and paste the functions you want to alter the behaviour of e.g. class Validate extends ValidateCore { /** * Check for e-mail validity * * @param string $email e-mail address to validate * @return boolean Validity is ok or not */ static public function isEmail($email) { return empty($email) OR preg_match('/^[a-z0-9!#$%&\'*+\/=?^`{}|~_-]+[.a-z0-9!#$%&\'*+\/=?^`{}|~_-]*@[a-z0-9]+[._a-z0-9-]*\.[a-z0-9]+$/ui', $email); } } (Note I haven't actually changed the above just copied and pasted it ....) Paul Link to comment Share on other sites More sharing options...
netline Posted August 10, 2011 Author Share Posted August 10, 2011 Assuming that you're using version 1.4.x.x You could override the functions in the Validate class. In the override/classes folder create a file called Validate.php containing: class Validate extends ValidateCore { } Then you can copy and paste the functions you want to alter the behaviour of e.g. class Validate extends ValidateCore { /** * Check for e-mail validity * * @param string $email e-mail address to validate * @return boolean Validity is ok or not */ static public function isEmail($email) { return empty($email) OR preg_match('/^[a-z0-9!#$%&\'*+\/=?^`{}|~_-]+[.a-z0-9!#$%&\'*+\/=?^`{}|~_-]*@[a-z0-9]+[._a-z0-9-]*\.[a-z0-9]+$/ui', $email); } } (Note I haven't actually changed the above just copied and pasted it ....) Paul Hi Paul, Thx for your quick reply ! I just tested your solution and it seems to work ! Many thx Link to comment Share on other sites More sharing options...
tamarillojohn Posted August 26, 2011 Share Posted August 26, 2011 Is there a way of changing this email validation in Prestashop 1.3.1.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