Page 1 of 1

Email address does not appear to be valid - On mobile version using autocomplete

Posted: Mon Aug 20, 2018 6:03 pm
by mike331487
Hi,

Opencart Version 3.0.2.0 using default checkout and no other extensions active.
This error only occurs when using the mobile view - please see below;

** During checkout and filling in 'personal details', when entering an email address using the 'autocomplete' of whatever device you are using **
1, Start to enter the email address and then let autocomplete takes over to fill in the rest of the email field
2, When all of the required fields are filled in correctly press 'continue'
3, An error message appears which states 'email address does not appear to be valid'

I have tried different email addresses but it throws up the same error with them, but when I enter the same email address/s manually it is accepted an allows you to continue checkout.

Any help would be much appreciated.

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Mon Aug 20, 2018 6:44 pm
by synapseindia
Hi ,

Try after disable the autocomplete .
For example -

Code: Select all

<input type="email" name="email" autocomplete="off">
Thanks

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Mon Aug 20, 2018 8:56 pm
by mike331487
Thanks for your reply synapseindia,
Please, could you tell me which file needs to have this added to it to stop the autocomplete?

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Tue Aug 21, 2018 8:01 pm
by mike331487
After further investigation, I'm going to post this on the Opencart report bugs problem as I'm now sure it's a fault and is affecting every opencart site I've tried.
It's actually to do with the predictive text/word feature which is found on most mobile devices and Opencart not recognising that an email address has been entered where the predictive email has been entered automatically.

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Tue Aug 21, 2018 8:47 pm
by synapseindia
mike331487 wrote:
Mon Aug 20, 2018 8:56 pm
Thanks for your reply synapseindia,
Please, could you tell me which file needs to have this added to it to stop the autocomplete?
You can go to "catalog\view\theme\default\template\checkout" and change it both file "payment_address.twig" and "shipping_address.twig" files. There you can find the input field . Just add autocomplete="off" same as i have mentioned in above reply.
Also, you can create an ocmod for those changes. It will not impact on default files of opencart.

Thanks

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Wed Aug 22, 2018 5:03 am
by mike331487
Thanks for the reply, I will give it a try but don't think that it will work as it is the actual predictive text from the mobile phone/tablet that predicts the email address - for example:
On checkout the customer using his mobile phone fills in his details and starts to enter his email address, the predictive text feature on his mobile phone recognises from the first few letters which email he is typing in and predicts the email address, which the user can then select by clicking on it.
The email address is then entered into the email field on opencart but opencart thinks that there is nothing there and throws up the error message "email address does not appear to be valid'
Now the customer can't progress through the checkout any further - the only way round this is to actually enter the exact same email address manually, so it's not an issue with the email address.
The error effects every single opencart shop I've tried it on so I think that a lot of sellers will be losing potential orders as the customer is left unable to checkout.

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Wed Aug 22, 2018 5:45 pm
by ostechnologies
Try using different browser and also try clearing your mobile browser’s cache and hit a try.

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Wed Aug 22, 2018 7:57 pm
by mike331487
synapseindia wrote:
Tue Aug 21, 2018 8:47 pm
mike331487 wrote:
Mon Aug 20, 2018 8:56 pm
Thanks for your reply synapseindia,
Please, could you tell me which file needs to have this added to it to stop the autocomplete?
You can go to "catalog\view\theme\default\template\checkout" and change it both file "payment_address.twig" and "shipping_address.twig" files. There you can find the input field. Just add autocomplete="off" same as i have mentioned in above reply.
Also, you can create an ocmod for those changes. It will not impact on default files of opencart.

Thanks


I've searched the above twig files for the code you suggest I add the extra code to (<input type="email")but they don't seem to contain the code in opencart 3.0.2.0 - or do I just need to add the full line of code as below?

<input type="email" name="email" autocomplete="off">

Thanks,

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Thu Aug 23, 2018 2:10 am
by mike331487
Ok, I think I've found what is causing the problem - when using predictive text on a mobile phone it adds a space after each word it inputs (so that there are spaces between words) so when it enters the email field there is a space after the email and opencart will not accept it, if the space is removed the email is accepted.
Please can someone tell me how I can make opencart accept an email address with a space at the end when the customer is entering their email during checkout.
Any help would be much appreciated.

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Thu Aug 23, 2018 8:44 pm
by synapseindia
mike331487 wrote:
Thu Aug 23, 2018 2:10 am
Ok, I think I've found what is causing the problem - when using predictive text on a mobile phone it adds a space after each word it inputs (so that there are spaces between words) so when it enters the email field there is a space after the email and opencart will not accept it, if the space is removed the email is accepted.
Please can someone tell me how I can make opencart accept an email address with a space at the end when the customer is entering their email during checkout.
Any help would be much appreciated.
You can use trim function to remove extra spaces from input value.
On controller file you can add trim function.
Fore reference - http://www.testingbrain.com/php-tutoria ... tring.html
Thanks

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Fri Aug 24, 2018 6:21 am
by mike331487
Thanks for your help synapseindia and the link to how to use the trim function.
I don't have much understanding of code but will try to learn how to use the trim function, could you please tell me which controller file I need to add the trim function to though?
Thanks

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Fri Aug 24, 2018 6:36 pm
by synapseindia
You have to edit the files in "catalog\controller\checkout" directory .
Also, you can use trim function while getting values -
for example -

Code: Select all

$email  = trim($this->request->post['email']);
For more information related to opencart file structure you can visit to the opencart documentation panel.
Thanks.

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Fri Aug 24, 2018 10:06 pm
by mike331487
I'm a bit confused - do I need to just add the below code or change some of the existing code?

$email = trim($this->request->post['email']);

Also regarding which files I need to change, will these be the /catalog/controller/checkout/guest.php and /catalog/controller/checkout/register.php?

Thanks,

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Mon Aug 27, 2018 7:29 pm
by synapseindia
You have to edit both files.

Also, i have posted an example how you can use trim function . You need to edit existing code no need to add extra field or code.

Thanks

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Mon Aug 27, 2018 7:39 pm
by straightlight
Solution already provided here: viewtopic.php?f=20&t=152761&p=732541#p732541

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Sat Jan 05, 2019 4:28 am
by tlegends
straightlight wrote:
Mon Aug 27, 2018 7:39 pm
Solution already provided here: viewtopic.php?f=20&t=152761&p=732541#p732541
The requested topic does not exist.

Re: Email address does not appear to be valid - On mobile version using autocomplete

Posted: Tue Jan 15, 2019 4:43 pm
by TonGeul
anybody ? have the same problem. but link doesnt work