Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 required fields in check out
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ablgoose
Starting Member

United Kingdom
1 Posts

Posted - May 18 2004 :  10:34:09  Show Profile  Reply with Quote
Hi

Does anyone know how you disable the required fields from the check out process?

I want to make the email and telephone number fields NOT required. I can't seem to see how to di it in the developer guide.

I'm using MSAccess in v5x

any thoughts would be welcome.

many thanks

Andy

jonmadrid
VP-CART New User

USA
192 Posts

Posted - May 18 2004 :  10:57:53  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
Hi there,

It takes a few steps and requires editing the code but its farily easy. Here's what you need to do (the explanation is below):

1) Edit shopcustomerform.asp by looking for this:

*******
CreateCustRow getlang("langCustPhone"),"strPhone", strPhone, "Yes"
CreateCustRow getlang("langCustEmail"), "strEmail", strEmail, "Yes"
*******

and replacing it with this:

*******
CreateCustRow getlang("langCustPhone"),"strPhone", strPhone, "No"
CreateCustRow getlang("langCustEmail"), "strEmail", strEmail, "No"
*******

2) Next, look for this:

*******
If strPhone = "" Then
sError = sError & getlang("langCustPhone") & getlang("langCustRequired") & "<br>"
End If

If strEmail = "" Then
sError = sError & getlang("langCustEmail") & getlang("langCustRequired") & "<br>"
Else
CustomerValidateEmail stremail
end If
*******

and replace it with this:

*******
If strPhone = "" Then
' sError = sError & getlang("langCustPhone") & getlang("langCustRequired") & "<br>"
End If

If strEmail = "" Then
' sError = sError & getlang("langCustEmail") & getlang("langCustRequired") & "<br>"
Else
CustomerValidateEmail stremail
end If
*******

3) Save the file and upload to server. That's all you need to do.

Now, the explanation:

Step 1 is for the display on the page and removes the * from next to the form field, denoting it as a reuired field. Note the "Yes" at the end of both of those lines was changed to a "No"... No = not required.

Step 2 takes care of the error handling. The original code looks to see if the fields are empty, and gives an error if they are. All I have done with the code example here is commented out the error generation part so that it basically just looks right over it and does nothing even if the field is empty. Now, I did NOT comment out the 'CustomerValidateEmail' call. The reason for that is that in case someone does enter there email adress, you will still be able to validate it as a proper e-mail address. The email address is not required, it just validates it if it happens to be entered.

Lastly, the reason I commented the code and out and don't suggest that you delete it altogether (even though it won't be used) is that if you ever want to revert back to the original way, all you need to do is go back and uncomment the code rather than have to rewrite it.

Easy as that. I hope that helps!

All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00