Making fields required in OPC
Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=3582
Printed Date: 19-July-2025 at 9:50pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Making fields required in OPC
Posted By: Guests
Subject: Making fields required in OPC
Date Posted: 01-April-2010 at 7:31pm
I searched the WIKI best I could to see if this might have been covered there, but didn't find anything.
How to make fields required in the OPC? Had a brief look at it, but it's not like other forms in PC in this way (no surprise there, eh?).
Specifically, I need to make the phone number field required. Curious that it is a required field in the CP, but not on OPC.
|
Replies:
Posted By: Greg Dinger
Date Posted: 01-April-2010 at 7:53pm
At line 118 of opc_updbilladdr.asp, we added this for the same requirement:
'gbdg mod - begin if pcStrBillingPhone="" then pcErrMsg=pcErrMsg & "<li>"&dictLanguage.Item(Session("language")&"_opc_99")&"</li>" end if 'gbdg mod - end
------------- GreyBeard Design Group
Certified ProductCart Developer
Web Design/Development/Hosting
http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |
|
Posted By: Guests
Date Posted: 01-April-2010 at 8:24pm
Thanks, Greg. I guess that will work well enough for now.
Would actually like to get some pointers on making it function like the rest of the validation here.
I see in the language file that some thought was given to this:
items opc_js_16 through 18 have the language for the alerts if validation fails.
Perhaps EI forgot to finish this?
|
Posted By: Guests
Date Posted: 02-April-2010 at 8:28pm
Hamish? Massimo? Cedric? Any love here?
Given the stuff in the languages file, was this something that was slated, but didn't get finished? Something you are working on for v4.1? If so, then Greg's band-aid is fine enough to tide over until then.
|
Posted By: ProductCart
Date Posted: 02-April-2010 at 9:24pm
Sean - in terms of the phone number specifically, it was not made required in v4, however it's already come up a few times... so we're looking at making it a variable in v4.1.
Recently, a Canadian customer asked about also making the Postal Code required for Canadian customers and to do that, a store simply needs to add their country code to the list at the top of the OPC page. For example:
Change:
var CountriesRequireZipCode="US,"
var CountriesRequireStateCode="US,"
var CountriesRequireProvince=""
To:
var CountriesRequireZipCode="US, CA"
var CountriesRequireStateCode="US,"
var CountriesRequireProvince=""
I guess that you are saying is that it would be nice for the store admin to have virtually total control over which fields they want to make required?
Regards,
Cedric Adams
Early Impact
------------- The ProductCart Team
Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software
|
Posted By: Guests
Date Posted: 02-April-2010 at 9:52pm
Well, I definitely thought about it, and it is pretty common in other shopping cart systems to select in the CP which Billing and Shipping fields you want to make required. I think it would be a good idea, but I wasn't throwing that in you lap here ;-)
However, there is a disconnect between the CP (where customer phone number is required) and the OPC (where it is not).
I was hoping for some pointers on using the same kind of authentication routine and display such as is used on other fields such as Name and Email.
|
Posted By: katharina
Date Posted: 02-April-2010 at 10:00pm
One thing that would be great is to require phone numbers for international orders. Currently the post office requires it on international shipments going to post boxes only, but more will be required soon. UPS requires it on all international shipments.
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Matt
Date Posted: 03-April-2010 at 1:59am
Hi Sean,
Open "onepagecheckoutJS.asp"
Replace:
billcountry: "required",
With:
billcountry: "required", billphone: "required",
Replace:
billcountry: { required: "<%=dictLanguage.Item(Session("language")&"_opc_js_12")%>" },
With:
billcountry: { required: "<%=dictLanguage.Item(Session("language")&"_opc_js_12")%>" }, billphone: { required: "<%=dictLanguage.Item(Session("language")&"_opc_js_16")%>" },
We have already updated the control panel so it does not validate the phone number. There is also an entry in our tracking system to make the validation optional.
|
Posted By: Guests
Date Posted: 03-April-2010 at 2:36am
Now that's what I'm talkin bout!
Thanks, did just what I wanted it to do.
So, moving forward, the question is: to allow folks to assign what fields should be required (I would expect that settings here would apply to both the control panel and the OPC) in the control panel, or to just put up a wiki post here on how to make fields required or not requited.
Immediate, easy way is to go the wiki route, IMHO.
Seems to me that the current un-required field here would be the phone number field as that is a bit of data most needed to follow up on potentially fraudulent orders.
|
|