ok. new problem. we are occasionally getting false PO box denies on addresses that are neither PO boxes or resemble PO boxes. hrrrrrm?
for instance, today one came in that was 568 Wagon Circle
ok. new problem. we are occasionally getting false PO box denies on addresses that are neither PO boxes or resemble PO boxes. hrrrrrm?
for instance, today one came in that was 568 Wagon Circle
Are you saying that "568 Wagon Circle" gets denied because I can't replicate that. Looking at the code, I can't see how a normal address could be caught by the mod. Have you customised the code at all?
If you do know of an address that gets caught when it shouldn't, either now or sometime in the future, let me know what it is (or a slight varient of it) and I will modify the mod for you. But until then there's not much I can do.PHP Code:
// BEGIN PO Box Ban 1/1
if (eregi('PO BOX', $street_address)) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if (eregi('POBOX', $street_address)) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if (eregi('P.O.', $street_address)) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if (eregi('P.O', $street_address)) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if (eregi('PO.', $street_address)) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
}
// END PO Box Ban 1/1
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
haven't modded the code at all. suddenly today, they've gotten 3 calls from people who can't register because of the PO box ban.
Strange. Well as I say, if you can replicate it just let me know the details. In the meantime, you might advise them to take down the mod if they don't want the problem repeated.
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
I was able to replicate it in three cases. All of which had the letters P and O in the street name. If I changed one or the other, they went through.
Now, in one case its Pioneer. So its not as if they have to be right next to eachother, either. And there's no period, etc.
Any ideas? the cart is prettybabynaturals.com
You're right, "Pioneer" does get denied. I believe it's because the .(dot) character has special meaning. I have been testing with the following code and it seems to be more accurate..
This is for includes/modules/your_template/create_account.phpPHP Code:
// BEGIN PO Box Ban 1/1
if ( preg_match('/PO BOX/si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if ( preg_match('/POBOX/si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if ( preg_match('/P\.O\./si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if ( preg_match('/P\.O/si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if ( preg_match('/PO\./si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
}
// END PO Box Ban 1/1
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
THANK you. i think that worked..... I can't tell you how much I appreciate you taking the time to examine this for me, and follow up.
No problem, thanks for confirming it worked
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
Hello! Using Zen Cart v 1.3.8. I want to make sure that I am correct before installing PO BOX BAN. We would like the PO BOX BAN on the shipping address and not on the billing address. Therefore, we install everything but the one part quoted above? (includes/modules/YOUR_TEMPLATE/create_account.php) and changing the code to tis:
// BEGIN PO Box Ban 1/1
if ( preg_match('/PO BOX/si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if ( preg_match('/POBOX/si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if ( preg_match('/P\.O\./si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if ( preg_match('/P\.O/si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
} else if ( preg_match('/PO\./si', $street_address) ) {
$error = true;
$messageStack->add('create_account', PO_BOX_ERROR);
}
// END PO Box Ban 1/1
for the includes/modules/your_template/create_account.php
Just making sure! I've already made a backup of course too!
Hi, installing everything except the code you mentioned would prevent customers from entering PO Box addresses for shipping, whilst allowing PO Box addresses being entered for billing. However, this mod only validates form submissions so with the approach you are thinking of taking, it's conceivable that a customer could enter their PO Box address for billing, then let that address also be the shipping address, effectively avoiding any validated forms. Ideally the mod should check for this, but until then, I think applying the mod to all address forms is the only guaranteed way of 'banning' them.
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
Bookmarks