Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 62
  1. #41
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    If you do not want to see Media when 1 or more Products from categories_id 65 is in the cart, then change the IF:
    Code:
    //if ($chk_media != $_SESSION['cart']->count_contents()) {
    if ($chk_media > 0) {
    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. #42
    Join Date
    Nov 2014
    Location
    Athens, GA
    Posts
    25
    Plugin Contributions
    0

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    Perfect! Thank you, it's working now.

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

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    Thanks for the update that this is now working 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: 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. #44
    Join Date
    Oct 2005
    Posts
    151
    Plugin Contributions
    0

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    Hi Ajeh,

    I just found this thread today. This is exactly the problem I am working on. I am creating a 1.5.5e site, which has the USPS module (USPS_2016_0107_K8). My client sells a variety of types (and weights) of items, including books. She would like the media shipping option to only appear when ONLY books are being purchased. Mixed type purchases do not qualify for media mail, according to the USPS website. All my clients books are in one sub-category together, which should make this easier, I would guess. But as I read through this thread, I got confused - perhaps because I am working with newer versions of Zen Cart and the USPS module. I made the recommended edits, but resulted in (apparently) excluding media mail from appearing in ALL situations. First, I put a non-media item in cart. No media shipping option appeared = good. Then, added a book to the same cart. Still no media option = also good. Then, I removed the non-media item from my cart so I had just a book in my cart. Still no media option appeared. Could you, perhaps, take a fresh look at this in the 1.5.5e Zen Cart and latest USPS module files and give me some instructions to accomplish my goal of media mail only appearing when ONLY items from the Books category are in the cart?

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

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    Look around line 702 and add:
    Code:
    $show_hiddenCost = '';
    // bof: test contents for Media Mail
    $skip_media = false;
    $chk_media = 0;
    $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','65');
    if ($chk_media != $_SESSION['cart']->count_contents()) {
    $skip_media = true;
    }
    // eof: test contents for Media Mail
    
    Then add:
    Code:
    // bof: test contents for Media Mail
              if ($type == 'Media Mail Parcel' && $skip_media) {
                // skip Media Mail
              } else {
              $methods[] = array('id' => $type_rebuilt,
                                 'title' => $title . $show_hiddenCost,
                                 'cost' => $cost,
                                 'insurance' => $usps_insurance_charge,
                                );
    }
    See if that helps ...
    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. #46
    Join Date
    Oct 2005
    Posts
    151
    Plugin Contributions
    0

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    Thank you! Worked like a charm!

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

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    Glad that all is working now!
    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. #48
    Join Date
    Jul 2014
    Posts
    5
    Plugin Contributions
    0

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    Updated to latest USPS (2022-08-07 K11e_) but having an issue with limiting Media Mail Parcel

    I would like to only allow Media Mail Parcel when a product from category 45 is in the cart.
    If another product is added that is not from category 35, then don't show Media Mail Parcel

    Noticed auto.usps_overrides.php

    if (stripos($p1, 'Media Mail') !== false) {
    $chk_media = 0;
    $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id', '45');
    if ($chk_media == $_SESSION['cart']->count_contents()) {
    $p2 = true;
    }


    Not understanding what to do

    $p2 = false; (Should I change this to True? )

    --------------------------------------------------------

    usps.php - Do I still need to add this? I added it to line 565


    // bof: test contents for Media Mail
    $skip_media = false;
    $chk_media = 0;
    $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','45');
    if ($chk_media != $_SESSION['cart']->count_contents()) {
    $skip_media = true;
    }
    // eof: test contents for Media Mail

    --------------------------------------------------------
    And this code? Not sure if the is needed since the auto.usps_overrides.php takes care of it? Add it in the Customization area?

    // bof: test contents for Media Mail
    if ($type == 'Media Mail Parcel' && $skip_media) {
    // skip Media Mail
    } else {
    $methods[] = array('id' => $type_rebuilt,
    'title' => $title . $show_hiddenCost,
    'cost' => $cost,
    );
    }
    // eof: test contents for Media Mail

  9. #49
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Media Mail restriction mod to new, 3-7-14 usps module, any help?

    The auto-loaded observer will take care of that; no need to provide additional edits to the usps.php shipping module. You'll change the observer's checking clause to read
    Code:
                case 'NOTIFY_USPS_UPDATE_OR_DISALLOW_TYPE':
                    // -----
                    // Disallow "Media Mail" unless all products in the cart have a master_categories_id of '45'.
                    //
                    if (stripos($p1, 'Media Mail') !== false) {
                        if ($_SESSION['cart']->in_cart_check('master_categories_id', '45') !== $_SESSION['cart']->count_contents()) {
                             $p2 = false;
                        }
                    }
                    break;

  10. #50
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    590
    Plugin Contributions
    0

    Default USPS override help?

    I see what's going on with the override, in general. But I don't know how the services are defined any more.

    For example, I've tried this code with the text "Small Flat Rate Box" and "USPS Priority MailTM Small Flat Rate Box" and "USPS Priority MailRM Small Flat Rate Box," and it isn't working with any of those. I recall when the designation changed from TM to RM, but neither of those appears to be correct any more.

    PHP Code:
                    // Disallow Small Flat Rate Box             
                    
    if (stripos($p1'Small Flat Rate Box') !== false) {
                       
    $chk_cart 0;
                       
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','1'); // golden paste
                       
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','2'); // spicees
                       
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','3'); // accessories
                       
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','5'); // livestock feed   
                       
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','10'); // oils
                       
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','11'); // pet products
                       
    $chk_cart += $_SESSION['cart']->get_quantity('148') > 0// Soothamide
                       
    if ($chk_cart == $_SESSION['cart']->count_contents() ) {
                          
    $p2 false;
                        } 
    I feel like I'm missing something obvious, sigh.

 

 
Page 5 of 7 FirstFirst ... 34567 LastLast

Similar Threads

  1. v139h USPS Media Mail problem.
    By Beau91324 in forum Addon Shipping Modules
    Replies: 4
    Last Post: 8 Jul 2014, 08:50 PM
  2. v150 USPS Module RateV3 -- trying to integrate Media Mail eligible option
    By jaheadlee in forum Addon Shipping Modules
    Replies: 1
    Last Post: 24 Jul 2012, 10:59 PM
  3. USPS-Offering Media mail on all items
    By flyred77 in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 2 Dec 2009, 12:04 AM
  4. Product Customization USPS Media Mail
    By rfloyd in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 30 May 2008, 09:46 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