Confirm email address

Modules, Add-ons and custom code that's more than just a quick hack or Mod.
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Confirm email address

Post by Painstik »

This is really stupid mistake from Interspire, users are entering only once their email so they make mistake very often and you don't get their real email address.

To fix this, go to the Tools -> Form Fields -> Create New Field (in Account Singup fields)
Name it: Confirm Email Address

Go to phpmyadmin, select table isc_formfields and find your new form field with label Confirm Email Address (it is last row) and click Edit (little pen icon)
Make this values for your new form field:

formfieldisrequired - 1
formfieldisimmutable - 1
formfieldprivateid - ConfirmEmailAddress
formfieldsort - 2

So now when you sorted this field to be 2nd (formfieldsort - 2) you have to edit fields Password (formfieldsort - 2 -> 3) and Confirm Password (formfieldsort - 3 -> 4) so that you have fields in a normal order:

Email Address
Confirm Email Address
Password
Confirm Password

Now we have created formfield, now we have to "connect" Email Address and Confirm Email Address form field.

Open: Panels/CreateAccountJavascript.html
Find:

Code: Select all

if (formfields[j].privateId == 'EmailAddress') {
						emailField = formfields[j];
Add after:

Code: Select all

} else if (formfields[j].privateId == 'ConfirmEmailAddress') {
						emailconfirmField = formfields[j];
Find:

Code: Select all

if(passwordField.value == "") {
			alert("%%LNG_AccountEnterPassword%%");
			FormField.Focus(passwordField.field);
			FormField.Focus(passwordField.field);
			return false;
		}
Add after:

Code: Select all

if((emailField.value != "" || emailconfirmField.value != "") && (emailField.value != emailconfirmField.value)) {
			alert("%%LNG_AccountEmailsDontMatch%%");
			FormField.Focus(emailconfirmField.field);
			return false;
		}
Open: language/front_language.ini
Add:

Code: Select all

AccountEmailsDontMatch = "Your Email accounts dont match"
Need custom coding for Interspire Shopping Cart? Contact me
Tony Barnes
Posts: 744
Joined: Thu Jun 18, 2009 8:59 am

Re: Confirm email address

Post by Tony Barnes »

Nice, might implement that as we occasionally get order confirmations bounce.
meules
Confirmed
Confirmed
Posts: 95
Joined: Wed Jun 17, 2009 8:56 pm
Location: NL

Re: Confirm email address

Post by meules »

Wow, neat... This happened a few times right now so I definetly going to implement this.

Thanks
ISC v6
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Confirm email address

Post by Painstik »

There is going to be some changes, cos this is only working for account registration. I need to make this javascript checking to work in checkout (when registering account and when checking out as guest)

Note: Interspire did a mess with express checkout... Don't know who drinks here, and who pays...
Need custom coding for Interspire Shopping Cart? Contact me
Tony Barnes
Posts: 744
Joined: Thu Jun 18, 2009 8:59 am

Re: Confirm email address

Post by Tony Barnes »

Can't it just be dumped into /js/express.checkout.js ?

Hah, just had a look, doesn't seem to be that easy. I can't even track down where the express checkout code is being generated from, is that all coming from the js..??? None of the snippets mentioned are in the cart....

Erm, good luck!
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Confirm email address

Post by Painstik »

Thx for support :x
Need custom coding for Interspire Shopping Cart? Contact me
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Confirm email address

Post by Painstik »

Ok, I did changes for express checkout, if somone is using normal checkout you'll have to do it yourself :P I think it's a lot easier than express checkout to make it.

Open: templates/_master/checkout_express.html
Find:

Code: Select all

lang.LoginEnterPassword = "%%LNG_LoginEnterPassword%%";
Add after:

Code: Select all

lang.AccountEmailsDontMatch = "%%LNG_AccountEmailsDontMatch%%";
Open: javascript/express.checkout.js
Find:

Code: Select all

if (formfield[i].privateId == 'EmailAddress') {
					if(formfield[i].value.indexOf('@') == -1 || formfield[i].value.indexOf('.') == -1) {
						alert(lang.LoginEnterValidEmail);
						FormField.Focus(formfield[i].field);
						return false;
					}
				}
Add after:

Code: Select all

if (formfield[i].privateId == 'EmailAddress' || formfield[i].privateId == 'ConfirmEmailAddress') {
					if (!ExpressCheckout.createAccount) {
						continue;
					} else if (formfield[i].privateId == 'EmailAddress') {
						email = formfield[i];
					} else {
						confirmEmail = formfield[i];
					}
				}
Find:

Code: Select all

if (!rtn.status) {
					alert(rtn.msg);
					FormField.Focus(formfield[i].field);
					return false;
				}
			}
Add after:

Code: Select all

// Compare the emails
			if (ExpressCheckout.createAccount && email.value !== confirmEmail.value) {
				alert(lang.AccountEmailsDontMatch);
				FormField.Focus(confirmEmail.field);
				return false;
			}

Now it works 100%, at least what i tested :)
Last edited by Painstik on Fri Jan 15, 2010 6:54 pm, edited 1 time in total.
Need custom coding for Interspire Shopping Cart? Contact me
Tony Barnes
Posts: 744
Joined: Thu Jun 18, 2009 8:59 am

Re: Confirm email address

Post by Tony Barnes »

Nice work - I'm still confused as to how that actually works (what bit generates the field?!?), but nice one. Will try it out on monday.
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Confirm email address

Post by Painstik »

Tony Barnes wrote:Nice work - I'm still confused as to how that actually works (what bit generates the field?!?), but nice one. Will try it out on monday.
Ummm... it works. How it works? Ask David Copperfield from Interspire who did this js programming :geek:
Need custom coding for Interspire Shopping Cart? Contact me
Tony Barnes
Posts: 744
Joined: Thu Jun 18, 2009 8:59 am

Re: Confirm email address

Post by Tony Barnes »

lmfao!!

When I looked at it the other day i had been thinking along the same lines as what you (ish...) but it made no sense as to how it would work so I aborted. Glad it's "magic" for you too
Post Reply