Results 1 to 10 of 12

Hybrid View

  1. #1
    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
    What identifies a Product as a CD or Vinyl?

    Anything like master_categories_id or some other field that can be used to identify Products to know who is what?
    We have them separated by categories in our store but that's it. Unfortunately I've been thrown in the fire with learning Zen Cart at a crazy learning curve.

    I don't even know what master_categories_id is

    For reference - www.piratespressrecords.com/store.

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

    Default Re: USPS Shipping Module Error

    The master_categories_id is the immediate categories_id that "owns" the Product in the table:
    products

    If you edit a Product, it will show you the master_categories_id at the top of the page:
    Product Master Category:
    The master_categories_id can be used as an identifier that a Product is a CD or Vinyl, if all CDs and Vinyls are in Categories that hold only CDs and/or Vinyls ...

    This would allow a count on Products in the shopping_cart that match the master_categories_id numbers of CDs and Vinyls vs the total item count in the cart ...

    The idea is, if the count of Products using these master_categories_id values matches the total items in the cart, then all Products are Media ... if not, then the whole cart is not Media ...
    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
    May 2013
    Location
    Long Branch, NJ
    Posts
    49
    Plugin Contributions
    0

    Default Re: USPS Shipping Module Error

    Quote Originally Posted by Ajeh View Post
    The master_categories_id is the immediate categories_id that "owns" the Product in the table:
    products

    If you edit a Product, it will show you the master_categories_id at the top of the page:


    The master_categories_id can be used as an identifier that a Product is a CD or Vinyl, if all CDs and Vinyls are in Categories that hold only CDs and/or Vinyls ...

    This would allow a count on Products in the shopping_cart that match the master_categories_id numbers of CDs and Vinyls vs the total item count in the cart ...

    The idea is, if the count of Products using these master_categories_id values matches the total items in the cart, then all Products are Media ... if not, then the whole cart is not Media ...
    Amazing. Thank you.

    So I guess I have to add a code to the PHP file that would allow the check out to ONLY use media mail for the selected Master ID Categories?

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

    Default Re: USPS Shipping Module Error

    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 ...
    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
    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 ...
    I'll check this out. Thank you! Sadly, I have no hair to pull out :/

  6. #6
    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 ...
    Alright so I took a look at it and I'm just not literate in PHP. I do know that the products ID categories are 4, 5, 6, and 7. But that's as far as I can get right now.

  7. #7
    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?

  8. #8
    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!

 

 

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