Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Posts
    254
    Plugin Contributions
    0

    Default USPS Max Shipping Weight + Exclude International

    Hi,

    I have been using

    Code:
    if (!IS_ADMIN_FLAG) {
          global $cart;
          if ($_SESSION['cart']->weight > 4.99 ) {
            $this->enabled = false;
          }
        }
    to disable the USPS method after a certain weight, and it works great. However, I only use USPS for international shipping and would like for the USPS weight limit to not apply to international addresses.

    Is this possible with a simple code change, or would it require a lot more work?

    Thanks!

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

    Default Re: USPS Max Shipping Weight + Exclude International

    I am not following what you are trying to do ...

    If you only use USPS for International ... and you do not want the weight limit on International ... why don't you just remove that code for the weight limit from USPS shipping module and create a Zone for International so that no one else can use it?
    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
    Oct 2008
    Posts
    254
    Plugin Contributions
    0

    Default Re: USPS Max Shipping Weight + Exclude International

    I meant that while USPS is my only international method, I still use USPS domestically for weight <5lbs and then UPS for weight >5lbs. So the code is an issue because it means all international orders must be under 5lbs - which I don't want.

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

    Default Re: USPS Max Shipping Weight + Exclude International

    You could try this ...

    Move your test for the weight down lower and have it only test when the country is 223 for the US, example, add the additional test in RED and move it down to around:
    Code:
        if (!IS_ADMIN_FLAG) {
          global $cart;
          if ($_SESSION['cart']->weight > 4.99 && $order->delivery['country']['id'] == 223) {
            $this->enabled = false;
          }
        }
        
        $this->types = array(
            'EXPRESS' => 'Express Mail', // ID="0"
            'FIRST CLASS' => 'First-Class Mail', // ID="1"
            'PRIORITY' => 'Priority Mail', // ID="2"
            'PARCEL' => 'Parcel Post', // ID="3"
            'MEDIA' => 'Media Mail', // ID="4"
            'LIBRARY' => 'Library' // ID="5"
            );
    I did not test this, so be sure to test it well for both shipping_estimator and checkout_shipping ...
    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!

  5. #5
    Join Date
    Oct 2008
    Posts
    254
    Plugin Contributions
    0

    Default Re: USPS Max Shipping Weight + Exclude International

    Thank you! Tested and it works in both the estimator and checkout process.

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

    Default Re: USPS Max Shipping Weight + Exclude International

    Thanks for the update that this works for you ...
    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. Replies: 49
    Last Post: 5 Dec 2014, 03:04 PM
  2. v139h Max weight restriction code for USPS Priority Mail Int Lrg Video box shipping option
    By heteromorphic in forum Addon Shipping Modules
    Replies: 9
    Last Post: 8 Sep 2012, 01:05 AM
  3. USPS max weight limit
    By buildingblocks in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 15 Sep 2011, 05:01 PM
  4. Max weight for first class mail international
    By riosouza in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 17 Feb 2010, 06:49 AM
  5. max weight for usps?
    By ryanb4614 in forum Addon Shipping Modules
    Replies: 11
    Last Post: 7 Nov 2008, 06:45 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