- Posts: 137
- Thank you received: 2
E-mail validation server side
10 years 2 months ago - 10 years 2 months ago #249237
by earmaster
E-mail validation server side was created by earmaster
-- 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?
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: 10 years 2 months ago by earmaster.
Please Log in or Create an account to join the conversation.
10 years 2 months ago #249253
by nicolas
Replied by nicolas on topic E-mail validation server side
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:
before the line:
let us know how it goes so that we can add it by default.
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:
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;
}
Code:
if(empty($this->registerData->name)){
Please Log in or Create an account to join the conversation.
10 years 2 months ago #249317
by earmaster
Replied by earmaster on topic E-mail validation server side
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.
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.
10 years 2 months ago #249324
by nicolas
Replied by nicolas on topic E-mail validation server side
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.
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.054 seconds