Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to restrict shipping to PO Box addresses?


Guest

Recommended Posts

Posted

Hi -

Is there a way to restrict shipping options if the address in question is a PO Box? I tried searching this group, but searching for "PO BOX" gives me an error. I'm guessing it's too short of a search string. Adding "shipping" gives all kinds of answers about shipping, but none about PO Boxes...

 

Since UPS can't ship to a PO Box, I'd like to restrict that from showing up if the address is a PO Box.

 

Do I need to edit code to do this or is there an easier way?

 

Thanks!

Posted

hrm...I used this code:

$test = strtolower(str_replace(".","", $street_address));//define $test as $street_address without periods and in all lower case ("P.O. Box" becomes po box)
 if (substr_count($test, "po") == 0 && substr_count($test, "box") == 0)//does $test contain "po" and "box"?

to check for an address that was a PO Box. That gets you halfway...but how to disable UPS shipping for that I don't know. I've put up a statement that says USPS is the only option for those with a PO Box, so far that's been fine for me.

  • 1 year later...
  • 3 months later...
Posted

This contribution lists 2 files to be altered - I can alter the fisrt one listed but what is supposed to be in the shipping.php file I do not have there. Any ideas? Can anyone help.

Kim

Posted

Hello, Thank you for the location. I modified the catalog/checkout_shipping.php file with your step one, then did a test. It seems to have taken out my usps shipping option all together. It does not offer it wherther it is a pos box or not. Am I modifying the correct file? I'm not sure why this is doing that.

So for now I just added to the screen that UPS does not deliver to PO Boxes or APO/FPO military addresses.

Thank you - Kim

Kim

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...