Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / P.O. Box Validation where user's can't ship to PO Box...

P.O. Box Validation where user's can't ship to PO Box...

Locked

Views: 2,225

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
5 Apr 2010, 2:00 PM
#1
zepher avatar

zepher

New Zenner

Join Date:
Jan 2010
Posts:
28
Plugin Contributions:
0

P.O. Box Validation where user's can't ship to PO Box...

Hi, is there an easy way (or a mod) that validates the shipping address where a user cannot enter a P.O. Box. We always have to call folks that enter a P.O. box for shipping and am wondering if there is a good way to validate the shipping address.

Thanks! :blink:

6 Apr 2010, 2:34 PM
#3
zepher avatar

zepher

New Zenner

Join Date:
Jan 2010
Posts:
28
Plugin Contributions:
0

Re: P.O. Box Validation where user's can't ship to PO Box...

Hi, installed it and I only need it to check the shipping address and to still allow for P.O. box to be used for billing address. I only used the checkout_new_address.php module and thought it might just work on shipping but it doesn't allow the user to use a PO box for billing either. I looked at the code and it looks like it just searches the whole form for p.o box enteries. I'm wondering if there is a way to skip the billing field or if there was a way to fix the code so it allows for a P.O box to be used for billing.

code:
// BEGIN PO Box Ban 1/1
if ( preg_match('/PO BOX/si', $street_address) ) {
$error = true;
$messageStack->add('checkout_address', PO_BOX_ERROR);
} else if ( preg_match('/POBOX/si', $street_address) ) {
$error = true;
$messageStack->add('checkout_address', PO_BOX_ERROR);
} else if ( preg_match('/P.O./si', $street_address) ) {
$error = true;
$messageStack->add('checkout_address', PO_BOX_ERROR);
} else if ( preg_match('/P.O/si', $street_address) ) {
$error = true;
$messageStack->add('checkout_address', PO_BOX_ERROR);
} else if ( preg_match('/PO./si', $street_address) ) {
$error = true;
$messageStack->add('checkout_address', PO_BOX_ERROR);
}
// END PO Box Ban 1/1

Can I exclude the billing address? :lamo:

7 Apr 2010, 3:13 PM
#4
zepher avatar

zepher

New Zenner

Join Date:
Jan 2010
Posts:
28
Plugin Contributions:
0

Re: P.O. Box Validation where user's can't ship to PO Box...

BUMP ,,,,

anyone know how to exclude the billing field for the P.O. Box Ban Mod?