Thread: USPS Question

Results 1 to 10 of 37

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Question

    Last question!!

    Would this work?

    PHP Code:
    global $cart;
              
    $chk_cats $_SESSION['cart']->in_cart_check('products_id','15')  + $_SESSION['cart']->in_cart_check('products_id','16' $_SESSION['cart']->in_cart_check('products_id','42' $_SESSION['cart']->in_cart_check('products_id','43');
            
    //  echo 'shipping ' . $type . ' chk_cats: ' . $chk_cats . '<br>';
              
    if ($type == 'Express Mail International (EMS) Flat-Rate Envelope' && $chk_cats 0) {
          if (
    $type == 'Priority Mail International Flat-Rate Envelope' && $chk_cats 0) {

    $chk_cats $_SESSION['cart']->in_cart_check('products_id','42')  + $_SESSION['cart']->in_cart_check('products_id','43');
            
    //  echo 'shipping ' . $type . ' chk_cats: ' . $chk_cats . '<br>';
              
    if ($type == 'First Class Mail International Package' && $chk_cats 0) {
          
    // skip shipping
              
    } else { 

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

    Default Re: USPS Question

    Not if you are trying to add them all up ...

    Can you type out slowly what it is you want this to do in detail ...

    You have Category issues with shipping types ...

    You have Product issues with shipping types ...

    You need to break these out carefully so that each shipping type that needs to be tested is using the correct testing ...
    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
    Aug 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Question

    Hi Ajeh,

    I want products 15,16,42,43 to ship by everything but Express Mail International (EMS) Flat-Rate Envelope and Priority Mail International Flat-Rate Envelope. I also want products 42 and 43, as well as not being shipped using the above two shipping types but also First Class Mail International Package.

    Thanks a million!

  4. #4
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Question

    Ajeh, would you please help me!

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

    Default Re: USPS Question

    I have not had the time to rewrite the code for you ... when I get some time I will try to look into this further ...

    Hopefully there is enough information in this thread to show you how to count the number of products in the cart based on master_categories_id or products_id etc. and how to find the $type for the shipping method to try coding this for yourself ...
    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!

  6. #6
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Question

    Trust me. I have tried! If you get a chance that would be great.

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

    Default Re: USPS Question

    You could use the code:
    Code:
    global $cart;
    $chk_products15 = $_SESSION['cart']->in_cart_check('products_id','15');
    $chk_products16 = $_SESSION['cart']->in_cart_check('products_id','16');
    $chk_products42 = $_SESSION['cart']->in_cart_check('products_id','42');
    $chk_products43 = $_SESSION['cart']->in_cart_check('products_id','43');
    
    $skip_type = false;
    if ( ($type == 'Express Mail International (EMS) Flat-Rate Envelope' || $type == 'Priority Mail International Flat-Rate Envelope') && ($chk_products15 + $chk_products16 + $chk_products42 + $chk_products43) > 0) {
      $skip_type = true;
    }
    
    if ( ($type == 'First Class Mail International Package' ) && ($chk_products42 + $chk_products43) > 0) {
      $skip_type = true;
    }
    
    if ($skip_type) {
      // do not show excluded shipping types
    } else {
              $methods[] = array('id' => $type,
                                 'title' => $title,
                                 'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
    }
    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 question
    By unmasked in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 21 Oct 2010, 07:13 AM
  2. USPS question
    By GraniteMan44 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 8 Apr 2008, 04:35 AM
  3. USPS Question
    By Tulameen in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 19 Oct 2006, 07:41 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