Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Setting Shipping Methods Based on Weight

    Thanks for the update and for posting the solution that worked 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!

  2. #12
    Join Date
    Jun 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Setting Shipping Methods Based on Weight

    Since the USPS update to the usps.php file, my changes I made to the file got overwritten. Thus I put the same code into the new usps.php file, but it doesn't work entirely correctly. It does toggle the shipping methods based on weight, but I think some of the names of the shipping methods changed. I've tried to change them, but I can't get it to work so I was hoping you could shed some light on what I'm doing wrong. The Priority methods work, but the GXG and Express don't.

    Here is some code from the usps.php file that I think tells the correct names, but changing it to either of the names doesn't seem to work (I've only included the methods I need working below):

    PHP Code:
    $this->intl_types = array(
            
    'Global Express' => 'Global Express Guaranteed',
            
    'Global Express Envelopes' => 'USPS GXG Envelopes',
            
    'Express Mail Int' => 'Express Mail International',
            
    'Express Mail Int Flat Rate Env' => 'Express Mail International Flat Rate Envelope',
            
    'Priority Mail International' => 'Priority Mail International',
            
    'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope',
            ); 

  3. #13
    Join Date
    Jun 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Setting Shipping Methods Based on Weight

    Upon further work, I was able to get the Express methods to show up by making the values in my previous code equate to the values on the right side of the names given directly above:

    PHP Code:
    $methods = array();
            
    $size sizeof($uspsQuote);
            for (
    $i=0$i<$size$i++) {
              list(
    $type$cost) = each($uspsQuote[$i]);

          
    // echo 'I SEE usps type: ' . $type . '<br>';

              // BOF: UPS USPS
              
    $title = ((isset($this->types[$type])) ? $this->types[$type] : $type);
              if(
    in_array('Display transit time'explode(', 'MODULE_SHIPPING_USPS_OPTIONS)))    $title .= $transittime[$type];
              
    /*
              $methods[] = array('id' => $type,
              'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type),
              'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
              */
              
              
    $show_it false;
              if (
    $usps_shipping_weight <= 0.99) {
                
    // if less than or equal to 0.99 and $type is Global Express Guaranteed, Express Mail International (EMS) Flat-Rate Envelope, or Priority Flat-Rate show it
                
    if ($type == 'Global Express Guaranteed') {
                  
    $show_it false;
                }
                if (
    $type == 'USPS GXG Envelopes') {
                  
    $show_it true;
                }
                if (
    $type == 'Express Mail International') {
                  
    $show_it false;
                }
                if (
    $type == 'Express Mail International Flat Rate Envelope') {
                  
    $show_it true;
                }
                if (
    $type == 'Priority Mail International') {
                  
    $show_it false;
                }
                if (
    $type == 'Priority Mail International Flat Rate Envelope') {
                  
    $show_it true;
                }
                
    // always show Domestic Shipping
                
    if ($type == 'EXPRESS') {
                  
    $show_it true;
                }
                if (
    $type == 'PRIORITY') {
                  
    $show_it true;
                }
             } else {
                
    // if greater than 0.99 show it
                
    if ($type == 'Global Express Guaranteed') {
                  
    $show_it true;
                }
                if (
    $type == 'USPS GXG Envelopes') {
                  
    $show_it false;
                }
                if (
    $type == 'Express Mail International') {
                  
    $show_it true;
                }
                if (
    $type == 'Express Mail International Flat Rate Envelope') {
                  
    $show_it false;
                }
                if (
    $type == 'Priority Mail International') {
                  
    $show_it true;
                }
                if (
    $type == 'Priority Mail International Flat Rate Envelope') {
                  
    $show_it false;
                }
                
    // always show Domestic Shipping
                
    if ($type == 'EXPRESS') {
                  
    $show_it true;
                }
                if (
    $type == 'PRIORITY') {
                  
    $show_it true;
                }
             }
              if (
    $show_it == true) {
                
    $methods[] = array('id' => $type,
                                   
    'title' => $title,
                                   
    'cost' => ($cost MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
              }
          } 
    I still can't get the Global Express and Global Express Envelopes to work though. I've changed them to both of the names on either side of the defined names above but nothing comes up in my store.

    Any ideas?

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

    Default Re: Setting Shipping Methods Based on Weight

    Perhaps the Jan 4, 2010 USPS Update will be of help to you:
    http://www.zen-cart.com/forum/showthread.php?t=144992

    Let us know if that works for you ...

    On your code, uncomment the echo so you can see exactly what to use in your IF statements for the type ...
    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. #15
    Join Date
    Jun 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Setting Shipping Methods Based on Weight

    Just had to change all instances referencing "Global Express Guaranteed" to "Global Express Guaranteed (GXG)" and it works.

    Thanks!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Different shipping methods based on quantity
    By falariem in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 19 Aug 2011, 12:06 AM
  2. Shipping multiple items based on total weight, but need weight per box.
    By Nineve in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 2 Aug 2010, 07:42 AM
  3. Zone Shipping Cost based on Individual item weight, not total order weight
    By pohnean in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 16 Sep 2009, 09:02 AM
  4. Changing shipping methods based on item weight??
    By krhody in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 12 Sep 2009, 09:11 PM
  5. Setting Up Shipping Prices based on categories or Based on Table?
    By CoolCarPartsOnline in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 21 May 2008, 07:22 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