You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I would like to stop P.O. boxes from being entered on the shipping address line 1 field. What's the best way?
Probably the easiest way is to login to the administrator and under HTML Pages & Elements | Manage Site Elements | Update Checkout - Intro Header right below the text:
###
Please complete the fields below to checkout. Once all of the required fields are complete, click the 'Submit' button to continue.<BR><BR>
###
Add in something like this:
###
<B>Please note: We ship via UPS. Please do not enter a P.O. Box number in the shipping address field below.</B><BR><BR>
###
___________________________
Nick Hendler
Webmaster, Kryptronic, Inc.
Offline
What if we wanted to implement an error screen either throught the Perl or Javascript so that it catches for some of the PO Box error conditions. Some of the error conditions may be:
- P.O. Box
- PO Box
- P.O Box
- Box
Using this error checking, we may be able to eliminate 90% of the PO Box shipping address that we get. Our UPS integration does not allow for PO Box shipping.
It would probably be easiest doing this with Perl rather than JavaScript. In the file ./cgi-bin/library/modules/ste_usr.pl look in the routine 'ste_usr_check' for the line:
###
my $temp_fd_value = $q->param($form_field);
###
And right behind it add:
###
if ($form_field eq "trackitem_shipaddressone" && ($temp_fd_value =~ /P.O. Box/ || $temp_fd_value =~ /PO Box/ || $temp_fd_value =~ /P.O Box/ || $temp_fd_value =~ /Box/)) {
$temp_fd_value = "";
} ######### End of if statement.
###
That will delete any shipping addresses (Line 1) that contain those phrases. The user will be forced to re-enter their info.
___________________________
Nick Hendler
Webmaster, Kryptronic, Inc.
Offline
I made the mod, but looks to have no effect.
Here's what the code looks like:
my ($fd_value,$form_field) = @_;
my $temp_fd_value = $q->param($form_field);
### Check for POBox
if ($form_field eq "trackitem_shipaddressone" && ($temp_fd_value =~ /P.O. Box/ || $temp_fd_value =~ /PO Box/ || $temp_fd_value =~ /P.O Box/ || $temp_fd_value =~ /Box/)) {
$temp_fd_value = "";
} ######### End of if statement.
###
if (defined($temp_fd_value)) {
$temp_fd_value = database_format($temp_fd_value);
Are you entering:
P.O. Box
PO Box
P.O Box
Box
In the shipping address? Are you just choosing to ship to the billing address? If that's the case, I may have to look at the code again.
___________________________
Nick Hendler
Webmaster, Kryptronic, Inc.
Offline
I tried it in only the instance where I chose the shipping address is the same as the billing address.
I have not tried the instance where the shipping address is different from the billing address.
I am using the 4 variations of PO Box, but each time it is just letting me go straight to the next screen.
In practice, the mod should handle both instances when the shipping address is same as Billing Address and when it is different.
thanks for looking into this.
To pick that up in the billing address to, change the line:
###
if ($form_field eq "trackitem_shipaddressone" && ($temp_fd_value =~ /P.O. Box/ || $temp_fd_value =~ /PO Box/ || $temp_fd_value =~ /P.O Box/ || $temp_fd_value =~ /Box/)) {
###
to read:
###
if (($form_field eq "trackitem_shipaddressone" && ($temp_fd_value =~ /P.O. Box/ || $temp_fd_value =~ /PO Box/ || $temp_fd_value =~ /P.O Box/ || $temp_fd_value =~ /Box/)) || ($form_field eq "tracking_addressone" && ($temp_fd_value =~ /P.O. Box/ || $temp_fd_value =~ /PO Box/ || $temp_fd_value =~ /P.O Box/ || $temp_fd_value =~ /Box/)) {
###
___________________________
Nick Hendler
Webmaster, Kryptronic, Inc.
Offline
How do you handle the situation where the customer has a PO Box for his billing address? CC Companies allow this.
We're all humanary stew, if we don't pledge allegiance to the Black Widow!
Offline
Anyone figout out a solutoin to Boo's question here? I was looking to implement the no shipping allowed to PO Boxes also, but allow it as billing address.
NOTE there needs to be an additional ) added in the code above such that it looks like this:
|| $temp_fd_value =~ /Box/))) {
Offline
In the meatime here's sort of a workaround we are using.
I've added the code nick suggested for both billing and shipping and noted at the top of the page that we do not SHIP to PO Boxes.
I then instructed the customer to use 'po_box' as the name to use for billing, thus bypassing Nick's list and not producing the error. I then informed the customer that any orders requesting shipment to po boxes will be cancelled in case they try to use the 'po_box' bypass as a slip thru.
i know this isn't very sophisticated, but it helps for now until a better solution comes around.
Offline
Kevbo,
This is what did for now and it seems to work well.
Kay
Offline