E-mail validation server side

  • Posts: 132
  • Thank you received: 2
8 years 2 months ago #249237

-- HikaShop version -- : 2.6.0

Hi!

I noticed that 2.6.0 doesn't have server side email validation, and haven't been able to spot the change in any of the change logs for the newer versions either, has this been implemented or is it still just JS / jQuery validation?

And if there is no server validation, would it be possible to add it through a plugin without messing anything in the checkout process up?

Last edit: 8 years 2 months ago by earmaster.

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 2 months ago #249253

Hi,

We didn't implement it as we didn't feel the need to so far. But it's not difficult to add.
Edit the file administrator/components/com_hikashop/classes/user.php and add the code:

		// Check if the fields are correctly filled, if not, return
		jimport('joomla.mail.helper');
		if(empty($this->registerData->email) || (method_exists('JMailHelper', 'isEmailAddress') && !JMailHelper::isEmailAddress($this->registerData->email))){
			$app->enqueueMessage(JText::_('EMAIL_INVALID'), 'error');
			return false;
		}
before the line:
if(empty($this->registerData->name)){
let us know how it goes so that we can add it by default.

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 2
8 years 2 months ago #249317

So far it seems to be working as it should during the checkout process.

How ever, a minor thing is that the email field is left empty after a failed validation, while that isn't a issue for us it might be something worth looking into adding.

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 2 months ago #249324

Hi,

That's actually normal. You want to empty the field if there is an error in it so that the customer can enter it again. It's the role of the JS validation to avoid the submission and mark the field as wrong.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum