Jump to content

Companies as customers


Recommended Posts

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

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

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

  • 3 weeks later...

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...