Post by supak111 » Wed May 22, 2024 4:39 am

I would like the first name field to be automatically selected when a customer reaches STEP-2 on checkout

Is there a way to do this?

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by straightlight » Wed May 22, 2024 5:21 am

supak111 wrote:
Wed May 22, 2024 4:39 am
I would like the first name field to be automatically selected when a customer reaches STEP-2 on checkout

Is there a way to do this?
OC version. If you're referring to guest customers that should have a selected first name field, I would not suggest that approach to be used since customers do have the right to modify their billing and shipping information that can differ with their customer's account when logged in to their account.

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 supak111 » Wed May 22, 2024 5:50 am

OC 3.0.3.2
I just want it selected so that customer can just start typing their first name without having to manually click on the first name field before they can start typing. Its no different than going to STEP-2 and clicking "Tab" button on your keyboard so the cursor moves over into the first name field

It would just speed up checkout, I don't see how it could do any harm

PS I read somewhere adding "autofocus" into the input tag would do this but I haven't had luck (maybe I'm doing it to the wrong file). Like this:

Code: Select all

<input name="q" autofocus />
.

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by straightlight » Wed May 22, 2024 6:18 am

supak111 wrote:
Wed May 22, 2024 5:50 am
OC 3.0.3.2
I just want it selected so that customer can just start typing their first name without having to manually click on the first name field before they can start typing. Its no different than going to STEP-2 and clicking "Tab" button on your keyboard so the cursor moves over into the first name field

It would just speed up checkout, I don't see how it could do any harm

PS I read somewhere adding "autofocus" into the input tag would do this but I haven't had luck (maybe I'm doing it to the wrong file). Like this:

Code: Select all

<input name="q" autofocus />
.
You're talking about the pointer. By doing that, however, it would also encourage bots to autofill the forms (even though they can already do it without the autofocus). This free extension could probably shed some light with some modifications on how to achieve this: https://www.opencart.com/index.php?rout ... n_id=37437 .

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 supak111 » Wed May 22, 2024 12:20 pm

Yea thats what I thought I had to do, just an add "autofocus" to the end of <input> tag but I can't seem to get it to work. Im probably adding it to the wrong file.

What file should it be added to so that it works on "Guest" checkout?

Thanks for the help btw ツ
.

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by paulfeakins » Wed May 22, 2024 6:40 pm

supak111 wrote:
Wed May 22, 2024 4:39 am
I would like the first name field to be automatically selected when a customer reaches STEP-2 on checkout
I would suggest using a One Page Checkout instead: https://www.antropy.co.uk/blog/whats-th ... -opencart/

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 82 guests