VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 General help me questions
 How to make Ship to name field mandatory ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aztech24
Starting Member

6 Posts

Posted - October 06 2009 :  12:30:54  Show Profile  Reply with Quote
How to make Ship to name field under Shipping Information mandatory on page shopcustomer.asp

I want that the form shouldnt be submitted until Ship to Name is filled in.

One option is by using Copy billing details to shipping, but if a customer dont checks that then the validation should be on Ship to name field.

carfin
VP-ASP Expert

United Kingdom
948 Posts

Posted - October 07 2009 :  03:58:32  Show Profile  Reply with Quote
Hi,

open file shopcustomerform.asp in a text or html editor.
Find the following sub routine:
Sub ShopShippingForm (line 140 approx)
Then find the following lines:
If getconfig("xshippingform")="Yes" then
CreateCustRow getlang("langShipName"),"shipname", strshipname,"No"

Change to highlighted green "No" to Yes.
This should make the ship to name field mandatory.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page

aztech24
Starting Member

6 Posts

Posted - October 07 2009 :  04:57:02  Show Profile  Reply with Quote
Hi Carrol
Thanks for the reply. After doing the changes I do see * behind the name but it doesnt do anything. There is no validation on it. If i leave Ship to Name blank still it allows me to fill out the form.

Is there anything else that i am missing
Go to Top of Page

carfin
VP-ASP Expert

United Kingdom
948 Posts

Posted - October 07 2009 :  06:23:25  Show Profile  Reply with Quote
I haven't dealt with shipping info much (our site doesn't use it) but I've had a look at shopcustomerform.asp and shopcustomer.asp and there doesn't seem to be a validation check for missing entries on the shipping form if the form is displayed.
However, there is a way of checking if you really want to stop an empty shipping name field.
In shopcustomerform.asp find Sub CustomerValidateEmail (stremail) (about line 415)
After the end sub line you need to add a new sub, let's say Sub ValidateShippingName.

Sub ValidateShippingName
If getconfig("xshippingform")="Yes" then
If strshipname = "" Then
sError = sError & getlang("langShipName") & getlang("langCustRequired") & "<br />"
End If
End if
End sub


Save this file then open file shopcustomer.asp and find Sub ValidateData (about line 186)
Find the line ValidateCustomerFields and immediately after this line, insert ValidateShippingName
We can now call the validation sub for the ship to name field if the form is displayed.

If I've missed an easier solution, perhaps someone else could point it out.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page

aztech24
Starting Member

6 Posts

Posted - October 07 2009 :  08:29:24  Show Profile  Reply with Quote
Thanks a lot Carrol

That did the work !!!!

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000