Thread: USPS Question

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 37
  1. #21
    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: v1.5.5]
    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. #22
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Question

    Thanks a million! Works a charm!

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

    Default Re: USPS Question

    Thanks for the update that this customized code works for you ... remember us when you are rich and famous ...
    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: v1.5.5]
    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!

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

    Default Re: USPS Question

    I've tried to change the code somewhat and it still displays the shipping options ive excluded. Any help would be appreciated!

    I'm using the newest version of zen-cart and USPS module.

    PHP 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');
    $chk_products73 $_SESSION['cart']->in_cart_check('products_id','73');
    $chk_products74 $_SESSION['cart']->in_cart_check('products_id','74');
    $chk_products76 $_SESSION['cart']->in_cart_check('products_id','76');
    $chk_products77 $_SESSION['cart']->in_cart_check('products_id','77');
    $chk_products81 $_SESSION['cart']->in_cart_check('products_id','81');
    $chk_products82 $_SESSION['cart']->in_cart_check('products_id','82');
    $chk_products83 $_SESSION['cart']->in_cart_check('products_id','83');
    $chk_products84 $_SESSION['cart']->in_cart_check('products_id','84');



    $skip_type false;
    if ( (
    $type == 'First-Class Mail International Large Envelope' ||$type == 'First-Class Mail International Package' ||$type == 'Priority Mail International Flat Rate Envelope' ||$type == 'Priority Mail International Small Flat Rate Box' ||$type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 +$chk_products16 $chk_products42 $chk_products43 $chk_products73 $chk_products74 $chk_products76 + + $chk_products77 $chk_products81 $chk_products82 $chk_products83 $chk_products84 +) > 0) {
      
    $skip_type true;
    }

    if ( (
    $type == 'Priority Mail International Medium Flat Rate Box' ) && ($chk_products42 $chk_products43 $chk_products74 $chk_products77 $chk_products83 $chk_products84 ) > 0) {
      
    $skip_type true;

    }

    if (
    $skip_type) {


      
    // do not show excluded shipping types
    } else { 

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

    Default Re: USPS Question

    Fix this IF statement:
    Code:
    if ( ($type == 'First-Class Mail International Large Envelope' || $type == 'First-Class Mail International Package' || $type == 'Priority Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box' || $type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 + $chk_products16 + $chk_products42 + $chk_products43 + $chk_products73 + $chk_products74 + $chk_products76 + $chk_products77 + $chk_products81 + $chk_products82 + $chk_products83 + $chk_products84) > 0) {
    then ... check what the $type is by adding above the two IF statements the line:
    Code:
    echo 'I SEE TYPE: ' . $type . '<br>';
    Make sure that you are testing for the correct spellings ...
    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: v1.5.5]
    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. #26
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Question

    What's wrong with the IF statement? This is what I did!

    PHP Code:
    $skip_type false;

    echo 
    'I SEE TYPE: ' $type '<br>';


    if ( (
    $type == 'First-Class Mail International Large Envelope' || $type == 'First-Class Mail International Package' || $type == 'Priority Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box' || $type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 $chk_products16 $chk_products42 $chk_products43 $chk_products73 $chk_products74 $chk_products76 $chk_products77 $chk_products81 $chk_products82 $chk_products83 $chk_products84) > 0) {  $skip_type true;
    }

    echo 
    'I SEE TYPE: ' $type '<br>';


    if ( (
    $type == 'Priority Mail International Medium Flat Rate Box' ) && ($chk_products42 $chk_products43 $chk_products74 $chk_products77 $chk_products83 $chk_products84 ) > 0) {
      
    $skip_type true;


    }

    if (
    $skip_type) {


      
    // do not show excluded shipping types
    } else { 
    Is this what you mean? nothing happened! Most likely its something I did I'd say!

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

    Default Re: USPS Question

    Your IF:
    Code:
    if ( ($type == 'First-Class Mail International Large Envelope' ||$type == 'First-Class Mail International Package' ||$type == 'Priority Mail International Flat Rate Envelope' ||$type == 'Priority Mail International Small Flat Rate Box' ||$type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 +$chk_products16 + $chk_products42 + $chk_products43 + $chk_products73 + $chk_products74 + $chk_products76 + + $chk_products77 + $chk_products81 + $chk_products82 $chk_products83 + $chk_products84 +) > 0) {
    My IF:
    Code:
    if ( ($type == 'First-Class Mail International Large Envelope' || $type == 'First-Class Mail International Package' || $type == 'Priority Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box' || $type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 + $chk_products16 + $chk_products42 + $chk_products43 + $chk_products73 + $chk_products74 + $chk_products76 + $chk_products77 + $chk_products81 + $chk_products82 + $chk_products83 + $chk_products84) > 0) {
    You have extra + signs and missing + signs ...
    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: v1.5.5]
    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!

  8. #28
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Question

    Oops... I see my mistakes! I changed the IF statement but still no change?

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

    Default Re: USPS Question

    Have you an URL to your site that we could perhaps peek at?
    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: v1.5.5]
    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!

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

    Default Re: USPS Question

    You are using the New USPS shipping module for January 4, 2010 correct?
    http://www.zen-cart.com/forum/showthread.php?t=144992
    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: v1.5.5]
    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 3 of 4 FirstFirst 1234 LastLast

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

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR