Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12
  1. #11
    Join Date
    May 2013
    Location
    Long Branch, NJ
    Posts
    49
    Plugin Contributions
    0

    Default Re: USPS Shipping Module Error

    Quote Originally Posted by Ajeh View Post
    You might look over this thread:
    http://www.zen-cart.com/showthread.p...ia-Mail-Option

    and see if it gives you some idea of how to do this ...

    If you really start to cry and pull your hair out, I might casually try to do a quick review on how to adapt that to the current USPS 3-27-2013 shipping module when I get some time ...
    Could I just possibly PM you?

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

    Default Re: USPS Shipping Module Error

    Try this ...

    Customize the USPS shipping module:
    /includes/modules/shipping/usps.php

    and add the code in Red around line 305 or so:
    Code:
          if (isset($uspsQuote['Package']['Postage']) && zen_not_null($uspsQuote['Package']['Postage'])) {
            $PackageSize = 1;
          } else {
            $PackageSize = ($this->usps_countries == 'US') ? sizeof($uspsQuote['Package']) : sizeof($uspsQuote['Package']['Service']);
          }
    
    // bof: test for media mail eligible
                $cart_count = $_SESSION['cart']->count_contents();
                $chk_products = 0;
                $media_valid = true;
          $chk_products += $_SESSION['cart']->in_cart_check('master_categories_id','4');
          $chk_products += $_SESSION['cart']->in_cart_check('master_categories_id','5');
          $chk_products += $_SESSION['cart']->in_cart_check('master_categories_id','6');
          $chk_products += $_SESSION['cart']->in_cart_check('master_categories_id','7');
          if ($cart_count == $chk_products) {
            $media_valid = true;
          } else {
            $media_valid = false;
          }
    // eof: test for media mail eligible
    
          for ($i=0; $i<$PackageSize; $i++)
    and then add the code in Red 418 or so:
    Code:
            $title .= $this->transittime[$type];
    
    // bof: test for media mail eligible
            if ((($method == '' && in_array($type, $types)) || $method == $type) && $usps_shipping_weight <= $maxweight && $usps_shipping_weight > $minweight) {
    //echo 'USPS $type: ' . $type . '<br>';
              if ($type == 'Media MailRM' && !$media_valid) {
                // skip media
              } else {
              $methods[] = array('id' => $type,
                                 'title' => $title,
                                 'cost' => $cost,
                                );
              }
    // eof: test for media mail eligible
    
            }
          }
    
          if (sizeof($methods) == 0) return false;
    see if that shows Media only when Products are in categories 4, 5, 6 and 7 ...
    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!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. USPS Shipping Module Error
    By outeredge2 in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 10 Mar 2013, 07:07 AM
  2. USPS Shipping module and debug error
    By buildingblocks in forum Addon Shipping Modules
    Replies: 6
    Last Post: 13 Nov 2010, 09:27 PM
  3. USPS Shipping Module Error Codes
    By AirsoftOutfitter in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 28 Jun 2010, 11:36 PM
  4. USPS SHipping module error
    By dldesigntore in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 22 Mar 2010, 11:31 PM
  5. Internal error caused by USPS Shipping Module, How to resolve it?
    By transtor in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 19 Mar 2009, 01:01 AM

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