No P.O. Box

Contrib type: 
Module
Status: 
Complete and working
Moderation: 
Full approval

Downloads

Compatibility: 
Ubercart 1.x

This module adds a validation function to the checkout form to prevent customers from specifying P.O. boxes as their delivery address. It's very lightweight and will just sit here for now. Smiling

PreviewAttachmentSize
uc_nopobox.zip1.09 KB
jrust's picture
Offline
Joined: 12/19/2007
Juice: 121
Re: No P.O. Box

Just a heads up to those that come across this, that uc_po_condition is similar to this module, except that it is used for determining different shipping methods if delivery is to a P.O. Box.

jpdaut's picture
Offline
Joined: 02/25/2009
Juice: 69
Re: Re: No P.O. Box

UC P.O. Condition is for Drupal 6 only. Does anyone have a version for Drupal 5 they would be willing to share?

Is the port to 5 a lot of work?

jrust's picture
Offline
Joined: 12/19/2007
Juice: 121
Re: Re: Re: No P.O. Box

The original PO Condition posted as a contrib on this site is actually for d5 and should work.

jasonabc's picture
Offline
Uber Donor
Joined: 05/05/2008
Juice: 573
Drupal 6 ubercart 2

does this work on D6/UC2?

jrchew's picture
Offline
Joined: 07/27/2009
Juice: 14
no

Nah, only works with UC1. Anyone interested in porting it to UC2? I think a lot of people would embrace such an idea.

cookiesunshinex's picture
Offline
Joined: 10/14/2009
Juice: 127
Re: no

I'm looking for a Drupal 6, Ubercart 2 port.

janette's picture
Offline
Joined: 06/22/2009
Juice: 22
D6 version

used deadwood module to convert, seems to work just fine (drupal 6.15/ubercart 2)

AttachmentSize
uc_nopobox.zip 2.04 KB
pdesai's picture
Offline
Joined: 01/27/2010
Juice: 12
Workflow-ng Solution

Instead of disabling all PO Box shipping - since USPS does ship to PO Box, I would recommend setting up a Workflow-ng for FedEx to disable for PO Box address. Below is the code I have used to setup a custom PHP code workflow with Negates option checked:

<?php
$text
= str_replace(array(" ", "\t", "\n", "\r", "\0", "\x0B"), '', $order->delivery_street1);
$text = str_replace(array(".", ",", ":", ";"), '', $text);
$text = strtolower($text);

$text2 = str_replace(array(" ", "\t", "\n", "\r", "\0", "\x0B"), '', $order->delivery_street2);
$text2 = str_replace(array(".", ",", ":", ";"), '', $text2);
$text2 = strtolower($text2);

if ((

strpos($text, 'pobox') !== FALSE) || (strpos($text2, 'pobox') !== FALSE))
    return
1;
else
    return
0;
?>

NOTE: This forum puts <? php ?> for code block, but you DO NOT need those when you put this in the custom PHP code (please copy between those two).

And it works perfectly when someone puts in a PO Box shipping address - it only shows USPS - otherwise it shows FedEx for all normal addresses.

Hope this helps others!

cookiesunshinex's picture
Offline
Joined: 10/14/2009
Juice: 127
Re: No P.O. Box

Please see my comments here -> http://drupal.org/node/663636