Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    9
    Plugin Contributions
    0

    Default Need to block certain zip codes from UPS

    Hi,
    I'm hoping someone can point me in the right direction. We offer free delivery to one set of US zip codes, flat rate shipping to another set of zip codes and UPS and USPS shipping to another set of zip codes. We also offer free shipping for several product categories.

    We have Freeshipper, UPS, USPS and Zipcode rate (for the flat rate since it is zip code specific) mods installed. All calculations are correct for all zip codes at checkout, but what we need to do is block a module if it is not applicable.

    In other words, when product is free shipping, the only information that shows up on the Delivery Options page is one box that says "Free Shipping Only." However, if the customer's delivery address is within the flat rate Zipcode rate area, he sees a box for the flat rate, a box for UPS, a box for USPS. As this is very confusing to the customer, all I want him to see is the box that lists the flat rate.

    I've read numerous posts about how to block specific categories or items from certain shipping methods, but haven't found anything on blocking specific zip codes.

    I suspect it may have something to do with adapting the following in each shipping module:

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
    }

    but haven't been able to figure it out.

    Thanks in advance for any help.

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

    Default Re: Need to block certain zip codes from UPS

    To block the Shipping or Delivery by Zip Code, you could use beneath that:
    Code:
    if (!IS_ADMIN_FLAG && in_array($order->delivery['postcode'], array(44026, 74136)) ) {
      $this->enabled = false;
    }
    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!]
    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!

  3. #3
    Join Date
    Jan 2009
    Posts
    9
    Plugin Contributions
    0

    Default Re: Need to block certain zip codes from UPS

    Hi Linda,
    Thanks so much for your quick response. I apologize for not responding in kind.

    Your solution worked perfectly. So perfectly, in fact, that I realized I had worked myself right into a pickle.

    For ease of explanation, let's say we sell apples and oranges:

    1) We ship apples and/or oranges to zip code 10001 for $5 on orders under $39, and for free on orders over $39. For this zip code we use the Zipship add-on and block the zip from the UPS Shipping Module and the Flat Shipping Module by using

    if (!IS_ADMIN_FLAG && in_array($order->delivery['postcode'], array(10001)) ) {
    $this->enabled = false;
    }

    2) We ship apples and/or oranges to zip code 10002 for $5, regardless of the order total. For this zip code I did what I did in 1) above.

    3) We ship apples to zip code 10003 for a flat rate of $5 regardless of the order total. For this we block zip codes 10001 and 10002 using the postcode "if" above, and we block the category ID for oranges by using

    // disable for one master_categories_id
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','51') > 0)) {
    $this->enabled = false;
    }

    in the Flat Shipping Module (where category 51 is oranges).

    Then, so the UPS Module doesn't appear as a shipping option at checkout, we

    // disable for one master_categories_id
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','50') > 0)) {
    $this->enabled = false;
    }

    in the UPS Shipping Module (where category 51 is apples).

    4) We ship oranges to zip code 10003 at UPS rates.

    Enter pickle.

    If a customer in zip code 10003 places both apples AND oranges in his cart, we want him to see the UPS rates. But, alas, he sees nothing, except my shipping pickle. The oranges were blocked in the Flat Rate Module and the apples were blocked in the UPS Module.

    I tried a number of ways to get around this, such as statements ending with

    $this->enabled = true;

    and a few other things I found in other threads, but can't seem to find an easy solution.

    For now, I've eliminated the Flat Rate shipping for apples to zip code 10003 and replaced it with UPS. Heck, if people don't want to order apples from me at UPS rates they can walk to the store in the snow.

    Thanks again very much for your time.

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

    Default Re: Need to block certain zip codes from UPS

    Sound like you are going to need a lot more complex shipping method to manage your apples and oranges scenarios to work with zip code constrictions ...

    If you cannot work it out on your own, you might look at the Commercial Help Wanted to see if this can be broken down in a better manner to manage the shipping and zip codes based on the products in the cart ...
    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!]
    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!

 

 

Similar Threads

  1. Allow Only Certain Zip Codes....
    By Lucentex in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Dec 2010, 01:02 PM
  2. Shipping to only certain zip codes
    By deker in forum Addon Shipping Modules
    Replies: 14
    Last Post: 19 May 2010, 02:10 PM
  3. using MZMT need + paypal express need to exclude orders from certain postal codes
    By roccanet in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 28 Nov 2007, 02:19 AM
  4. Block Customers from Certain Postal Codes
    By Sam_uk in forum Managing Customers and Orders
    Replies: 0
    Last Post: 17 Jul 2007, 01:40 PM

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