Author |
Topic |
|
aztech24
Starting Member
6 Posts |
Posted - October 06 2009 : 12:30:54
|
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-CART Expert
United Kingdom
948 Posts |
Posted - October 07 2009 : 03:58:32
|
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 |
|
|
aztech24
Starting Member
6 Posts |
Posted - October 07 2009 : 04:57:02
|
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 |
|
|
carfin
VP-CART Expert
United Kingdom
948 Posts |
Posted - October 07 2009 : 06:23:25
|
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 |
|
|
aztech24
Starting Member
6 Posts |
Posted - October 07 2009 : 08:29:24
|
Thanks a lot Carrol
That did the work !!!!
|
|
|
|
Topic |
|