Hi Jordana. Currently the contribution only validates the sign-up page and the 'add shipping address' at checkout. I did consider also validating the My Account area though I chose against this mainly because no overrides are available, and also because I felt that the majority of customers would be stopped either at sign-up or checkout and would consequently get the idea that PO Box addresses aren't welcome.
If you still want to validate the My Account area, you need to do the following. (This will validate both the Add Address and the Edit Address function).
Find this file:
includes/modules/pages/address_book_process/header_php.php
Just below this:
PHP Code:
if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
$error = true;
$messageStack->add('addressbook', ENTRY_STREET_ADDRESS_ERROR);
}
Add this:
PHP Code:
// BEGIN PO Box Ban 1/1
if (eregi('PO BOX', $street_address)) {
$error = true;
$messageStack->add('addressbook', PO_BOX_ERROR);
} else if (eregi('POBOX', $street_address)) {
$error = true;
$messageStack->add('addressbook', PO_BOX_ERROR);
} else if (eregi('P.O.', $street_address)) {
$error = true;
$messageStack->add('addressbook', PO_BOX_ERROR);
} else if (eregi('P.O', $street_address)) {
$error = true;
$messageStack->add('addressbook', PO_BOX_ERROR);
} else if (eregi('PO.', $street_address)) {
$error = true;
$messageStack->add('addressbook', PO_BOX_ERROR);
}
// END PO Box Ban 1/1
As previously mentioned, you will have to overwrite this file.
I will add these instructions to the mod in case anyone else wants to do the same.
Bookmarks