Results 1 to 3 of 3
  1. #1

    Default Modifing shipping options avaible to customer by catigories in shopping cart

    We are using the latest version of the USPS shipping module, and it is working quite well but we have run into a problem with Media Mail and Priority mail. Usually our products are shipped via Priority Mail but some of them can be shipped with Media Mail. The media Mail eligible products are all in their own categories so I'd like to be able to have some way of getting ZenCart to check to see if the shopping cart is filled with only those categories and if it is give the customer the option of selecting Media Mail. I really don't want to dive into the USPS Module code and make the changes code if someone has already worked out how to do this.

    Thanks
    Beau

  2. #2
    Join Date
    Mar 2008
    Posts
    49
    Plugin Contributions
    0

    Default Re: Modifing shipping options avaible to customer by catigories in shopping cart

    I needed something along those lines and received quite a bit of help in this thread;
    http://www.zen-cart.com/showthread.p...14-Issue/page2

    With a little tweaking, I think the solution would work for you as well.

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

    Default Re: Modifing shipping options avaible to customer by catigories in shopping cart

    To control when Media mail is available for when the shopping cart contains only Products from specific master_categories_id you can edit the module:
    /includes/modules/shipping/usps.php

    and add to code in RED around line 370:
    Code:
    // eof: example to block USPS Priority MailTM Small Flat Rate Box when anything from master_categories_id 12 or 15 are in the cart
    
    // bof: Media for specific master_categories_id
      $media_categories = 0;
      $media_categories += $_SESSION['cart']->in_cart_check('master_categories_id','10');
      $media_categories += $_SESSION['cart']->in_cart_check('master_categories_id','12');
      if ($_SESSION['cart']->count_contents() != $media_categories) {
        $skip_media = true;
      } else {
        $skip_media = false;
      }
    // bof: Media for specific master_categories_id
    
          for ($i=0; $i<$PackageSize; $i++) {
    and the code around line 629 in RED:
    Code:
    //echo '<br />USPS info: ' . '<br />$type: ' . $type . '<br />$type_rebuilt: ' . $type_rebuilt . '<br />$title: ' . $title . ' $cost: ' . $cost . '<br />';
    
    // bof: Media for specific master_categories_id
              if ($skip_media && preg_match('#MEDIA#i', $type)) {
                continue;
              }
    // eof: Media for specific master_categories_id
    
              if ($this->usps_countries == 'US' && MODULE_SHIPPING_USPS_FIRST_CLASS_FILTER_US == 'True' && preg_match('#First\-Class#i', $type) && $cnt_first > 1) continue;
    Just change or add the master_categories_id for:
    Code:
      $media_categories += $_SESSION['cart']->in_cart_check('master_categories_id','10');
    
    to the ones you need and add additional ones if needed ...
    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!

 

 

Similar Threads

  1. v150 Can I setup for different catigories shipping to different area?
    By su35 in forum Addon Shipping Modules
    Replies: 1
    Last Post: 7 Aug 2012, 08:32 PM
  2. Replies: 5
    Last Post: 29 Sep 2009, 01:33 AM
  3. Drop Shipping via modifing packing slip
    By systemagic in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 3 Jan 2008, 03:53 AM
  4. Shopping cart content field options
    By Justwade in forum Managing Customers and Orders
    Replies: 0
    Last Post: 16 Feb 2007, 06:07 AM

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