Post by Micas » Mon Aug 20, 2018 6:03 pm

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.

New member

Posts

Joined
Sat Sep 02, 2017 12:28 am

Post by synapseindia » Mon Aug 20, 2018 6:44 pm

Hi ,

Try after disable the autocomplete .
For example -

Code: Select all

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

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by Micas » 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?

New member

Posts

Joined
Sat Sep 02, 2017 12:28 am

Post by Micas » Tue Aug 21, 2018 8:01 pm

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.

New member

Posts

Joined
Sat Sep 02, 2017 12:28 am

Post by synapseindia » 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

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by Micas » Wed Aug 22, 2018 5:03 am

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.

New member

Posts

Joined
Sat Sep 02, 2017 12:28 am

Post by ostechnologies » Wed Aug 22, 2018 5:45 pm

Try using different browser and also try clearing your mobile browser’s cache and hit a try.

Opencart Expert | sales[at]ost.agency
Skype - manish.osuniverse | Gtalk - manishmt

Extensions for Opencart @ https://www.ost.agency/product/product- ... extensions
ost.agency - ecommerce website design, development and digital company


User avatar
Active Member

Posts

Joined
Mon Apr 06, 2015 1:30 pm

Post by Micas » Wed Aug 22, 2018 7:57 pm

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,

New member

Posts

Joined
Sat Sep 02, 2017 12:28 am

Post by Micas » 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.

New member

Posts

Joined
Sat Sep 02, 2017 12:28 am

Post by synapseindia » Thu Aug 23, 2018 8:44 pm

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

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by Micas » Fri Aug 24, 2018 6:21 am

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

New member

Posts

Joined
Sat Sep 02, 2017 12:28 am

Post by synapseindia » Fri Aug 24, 2018 6:36 pm

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.

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by Micas » Fri Aug 24, 2018 10:06 pm

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,

New member

Posts

Joined
Sat Sep 02, 2017 12:28 am

Post by synapseindia » Mon Aug 27, 2018 7:29 pm

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

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by straightlight » Mon Aug 27, 2018 7:39 pm

Solution already provided here: viewtopic.php?f=20&t=152761&p=732541#p732541

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by tlegends » Sat Jan 05, 2019 4:28 am

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.

New member

Posts

Joined
Thu Apr 14, 2016 10:45 am

Post by TonGeul » Tue Jan 15, 2019 4:43 pm

anybody ? have the same problem. but link doesnt work

New member

Posts

Joined
Fri Nov 09, 2012 6:36 am

Post by elanclarkson » Wed Nov 10, 2021 9:26 am

I have posted an (untested) solution for this issue here:

viewtopic.php?f=125&t=206658&p=831849#p831849

Newbie

Posts

Joined
Thu Jun 01, 2017 7:12 pm
Who is online

Users browsing this forum: No registered users and 261 guests