Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Dec 2005
    Posts
    166
    Plugin Contributions
    0

    Default No Shipping To Po Box?

    hOW do I set zen to not allow people to ship to PO Boxes??
    thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: No Shipping To Po Box?

    I did the following on one site:

    includes/modules/shipping/ups.php
    line 118 starts with:
    PHP Code:
      function quote($method '') {
        global 
    $_POST$order$shipping_weight$shipping_num_boxes;

        if (
    zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon$this->title); 
    I added a couple lines after that to check for PO boxes, like this:
    PHP Code:
      function quote($method '') {
        global 
    $_POST$order$shipping_weight$shipping_num_boxes;

        if (
    zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon$this->title);

        
    // disable this module if address contains "PO Box"
        
    $addr_check str_replace(array('.',' ''/'),'',strtoupper($order->delivery['street_address']));
        if (
    strstr($addr_check,'POBOX') || strstr($addr_check,'POSTOFFICEBOX')) {
          
    $this->quotes = array('module' => $this->title,
                                
    'error' => 'UPS cannot ship to a PO Box address.');
          return 
    $this->quotes;
        } 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Dec 2005
    Posts
    166
    Plugin Contributions
    0

    Re: No Shipping To Po Box?

    Dr Byte: I am using the Flat Shipping, is this the same code?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Re: No Shipping To Po Box?

    most likely would work the same.... don't add the code I repeated in the second box, just the extra code added
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2003
    Location
    CA
    Posts
    686
    Plugin Contributions
    0

    Default Re: No Shipping To Po Box?

    Quote Originally Posted by DrByte
    I did the following on one site:

    includes/modules/shipping/ups.php
    line 118 starts with:
    PHP Code:
      function quote($method '') {
        global 
    $_POST$order$shipping_weight$shipping_num_boxes;

        if (
    zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon$this->title); 
    what version of the module are you quoting above? in the latest version, that piece of code reads

    PHP Code:
         if ( (zen_not_null($method)) && (isset($this->types[$method])) ) { 
    so are you embedding the new code within the body of that IF statement, or before it now?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: No Shipping To Po Box?

    oops ... skip that line altogether ... I had relocated it from later in the file for other purposes

    Skip this in my examples above:
    PHP Code:
     if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon$this->title); 
    - thx for the catch Jeff
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jun 2003
    Location
    CA
    Posts
    686
    Plugin Contributions
    0

    Default Re: No Shipping To Po Box?

    no problem - just wanted to make sure I wasnt missing something

    so now, with the addition of your code snippet, it will look like this (correct?):


    PHP Code:
        if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon$this->title);

    // disable this module if address contains "PO Box" 
        
    $addr_check str_replace(array('.',' ''/'),'',strtoupper($order->delivery['street_address'])); 
        if (
    strstr($addr_check,'POBOX') || strstr($addr_check,'POSTOFFICEBOX')) { 
          
    $this->quotes = array('module' => $this->title
                                
    'error' => 'UPS cannot ship to a PO Box address.'); 
          return 
    $this->quotes
        }  
        
        return 
    $this->quotes;
      } 

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: No Shipping To Po Box?

    You also need to check for "BOX" at the beginning of the string, because not everyone specifies "PO" in their address.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: No Shipping To Po Box?

    PHP Code:
     if (strstr($addr_check,'POBOX') || strstr($addr_check,'POSTOFFICEBOX') || strstr($addr_check,'BOX')) { 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: No Shipping To Po Box?

    BOX alone may not be ideal ...

    The problem being folks using Mailboxes etc. my say Box 12 where they won't say PO Box 12 ...

    And Mailboxes etc. is a real location so UPS does deliver ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 What shipping module to use with shipping drop down box
    By U3nme in forum General Questions
    Replies: 6
    Last Post: 3 Nov 2012, 09:44 PM
  2. Shipping box count
    By sublime19 in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 11 Dec 2009, 06:35 PM
  3. Shipping box numbers
    By acummins in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 24 Oct 2009, 08:31 AM
  4. Shipping by box demesion
    By canemasters in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 14 Nov 2008, 04:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR