Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37
  1. #1
    Join Date
    Mar 2011
    Posts
    33
    Plugin Contributions
    0

    Default Giving USPS First-Class only for products in a certain category

    Hi,

    I have one category that lists all the golf shoes we carry and would like to give the option to ship by the USPS First Class Domestic/International. All other products will be shipped by either the Priority or Priority Express, including when customers buy a pair/pairs of golf shoes along with any other product from other categories. Could this be done?

    I run Zen Cart 1.3.9h in both English & Japanese with PHP 5.2.17 & MySQL 5.0.95. Any feedback would be appreciated.

    Thank you,

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

    Default Re: Giving USPS First-Class only for products in a certain category

    What is the master_categories_id for the 1 Category that you want to allow First Class?
    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!

  3. #3
    Join Date
    Mar 2011
    Posts
    33
    Plugin Contributions
    0

    Default Re: Giving USPS First-Class only for products in a certain category

    Quote Originally Posted by Ajeh View Post
    What is the master_categories_id for the 1 Category that you want to allow First Class?
    Hi Ajeh,

    Hope all is well. The master cat. id is 25.

    Thank you in advance for your continued support.

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

    Default Re: Giving USPS First-Class only for products in a certain category

    Edit the file:
    /includes/modules/shipping/usps.php

    and add the code in RED:
    Code:
    // bof: check Product Qty in categories_id 25
    $chk_cat = 0;
    $chk_cats = $_SESSION['cart']->in_cart_check('master_categories_id','25');
    // eof: check Product Qty in categories_id 25
          for ($i=0; $i<$PackageSize; $i++) {
    Code:
              if ($this->usps_countries == 'US' && MODULE_SHIPPING_USPS_FIRST_CLASS_FILTER_US == 'True' && preg_match('#First\-Class#i', $type) && $cnt_first > 1) continue;
    
    // bof: only show First Class/First-Class when entire cart is categories_id 25
    if ($chk_cats != $_SESSION['cart']->count_contents() && preg_match('#First\-Class#i', $type)) {
    //  echo 'USPS skip $type: ' . $type . '<br>';
      // skip First Class
    } else {
    //  echo 'USPS DO NOT skip $type: ' . $type . '<br>';
              $methods[] = array('id' => $type_rebuilt,
                                 'title' => $title,
                                 'cost' => $cost,
                                );
    }
    // eof: only show First Class/First-Class when entire cart is categories_id 25
    
    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!

  5. #5
    Join Date
    Mar 2011
    Posts
    33
    Plugin Contributions
    0

    Default Re: Giving USPS First-Class only for products in a certain category

    Quote Originally Posted by Ajeh View Post
    Edit the file:
    /includes/modules/shipping/usps.php

    and add the code in RED:
    Code:
    // bof: check Product Qty in categories_id 25
    $chk_cat = 0;
    $chk_cats = $_SESSION['cart']->in_cart_check('master_categories_id','25');
    // eof: check Product Qty in categories_id 25
          for ($i=0; $i<$PackageSize; $i++) {
    Code:
              if ($this->usps_countries == 'US' && MODULE_SHIPPING_USPS_FIRST_CLASS_FILTER_US == 'True' && preg_match('#First\-Class#i', $type) && $cnt_first > 1) continue;
    
    // bof: only show First Class/First-Class when entire cart is categories_id 25
    if ($chk_cats != $_SESSION['cart']->count_contents() && preg_match('#First\-Class#i', $type)) {
    //  echo 'USPS skip $type: ' . $type . '<br>';
      // skip First Class
    } else {
    //  echo 'USPS DO NOT skip $type: ' . $type . '<br>';
              $methods[] = array('id' => $type_rebuilt,
                                 'title' => $title,
                                 'cost' => $cost,
                                );
    }
    // eof: only show First Class/First-Class when entire cart is categories_id 25
    
    Ajeh,

    Thank you for your quick response. I forgot to mention that there are 7 sub-categories (id 29 thru 35) under that category 25, and each sub-category has 3 to 7 products. Also, I meant to give the First-Class shipping in addition to Priority & Priority Express for the golf shoes.

    Sorry for the confusion.

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

    Default Re: Giving USPS First-Class only for products in a certain category

    Code:
    // bof: check Product Qty in categories_id 29 - 35
    $chk_cat = 0;
    $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','29');
    $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','30');
    $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','31');
    $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','32');
    $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','33');
    $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','34');
    $chk_cats += $_SESSION['cart']->in_cart_check('master_categories_id','35');
    // eof: check Product Qty in categories_id 29 -35
    
          for ($i=0; $i<$PackageSize; $i++) {
    Try changing this part of the code ...
    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!

  7. #7
    Join Date
    Mar 2011
    Posts
    33
    Plugin Contributions
    0

    Default Re: Giving USPS First-Class only for products in a certain category

    Wow, you're amazing. Thank you so much for your assistance on this. I will make a donation for cups of coffee now!

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

    Default Re: Giving USPS First-Class only for products in a certain category

    Thanks for the update that this worked for you ... and especially a thanks for the coffee and donuts ... they are always a help to the Zen Cart Team!
    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!

  9. #9
    Join Date
    Mar 2011
    Posts
    33
    Plugin Contributions
    0

    Default Re: Giving USPS First-Class only for products in a certain category

    Ajeh,

    I started a new thread last night, but can allowing the USPS Priority Flat Rate Small Box to one product be added to the above codes?

    Thank you,

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

    Default Re: Giving USPS First-Class only for products in a certain category

    What happens on a mixed cart of Products?
    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 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 49
    Last Post: 5 Dec 2014, 03:04 PM
  2. First class mail not displaying for USPS Module
    By bocahydro in forum Addon Shipping Modules
    Replies: 6
    Last Post: 13 Sep 2013, 04:23 PM
  3. USPS: Different options for Priority vs. First Class mail?
    By lat9 in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 17 Jan 2010, 04:35 AM
  4. USPS Shipping Option for First Class Domestic not showing
    By DVMGuy in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 19 Jul 2008, 07:51 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