Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Restrict Next Day Shipping to Certain Items

    You could disable the Flat Rate flat shipping module by customizing it to only show when there are only Products from the 1 Category in it ...

    If you wanted to base this on categories_id 10, where that is the master_categories_id for the Products, you could use:
    Code:
    if (!IS_ADMIN_FLAG) {
      global $cart;
      $chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','10');
      if ($chk_cat != $_SESSION['cart']->count_contents()) {
        $this->enabled = false;
      }
    }
    Then customize the UPS shipping module to not show if only Products from the 1 Category are in it:
    Code:
    if (!IS_ADMIN_FLAG) {
      global $cart;
      $chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','10');
      if ($chk_cat == $_SESSION['cart']->count_contents()) {
        $this->enabled = false;
      }
    }
    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. #12
    Join Date
    Dec 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: Restrict Next Day Shipping to Certain Items

    Thanks for you help so far...

    Code:
    // disable for one master_categories_id 
          if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','1387') > 0)) { 
              // show flat 
              $this->enabled = true; 
          } else { 
              // hide flat 
              $this->enabled = false; 
              }
    This is what I currently have in my flat.php file. Do I add the code you wrote to the bottom of this or replace it?

    Code:
    // disable for one master_categories_id 
          if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','1387') > 0)) { 
              // show UPS 
              $this->enabled = false; 
          } else { 
              // hide UPS 
              $this->enabled = true; 
          }
    Similarly this is in my ups.php file. Again add or replace the code you wrote?

    Thanks for your patience.

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

    Default Re: Restrict Next Day Shipping to Certain Items

    My code is designed to:

    1 turn off the Flat Rate flat shipping module if 1 or more Products are not from the 1 Category ...

    2 turn off the UPS shipping module if ALL Products are from the 1 Category ...

    You would remove your 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!

  4. #14
    Join Date
    Dec 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: Restrict Next Day Shipping to Certain Items

    Humm...

    I inserted your code and now when i add the product that should only be able to be shipped flat rate it says

    Sorry, we are not shipping to your region at this time.
    EDIT: FML i forgot to change the category from the 10 you set to the actual category.

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

    Default Re: Restrict Next Day Shipping to Certain Items

    Does that mean it is now working?
    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. #16
    Join Date
    Dec 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: Restrict Next Day Shipping to Certain Items

    Quote Originally Posted by Ajeh View Post
    Does that mean it is now working?
    Yes it is. Thank you.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 Can I restrict certain shipping modules for certain products?
    By gumboot in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 13 Feb 2013, 05:26 AM
  2. restrict shipping certain products to certain states?
    By airtime in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 18 Jan 2011, 05:11 AM
  3. Shipping problems - UPS only giving Next Day and 2nd day?
    By ijarofjami in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 3 Oct 2009, 04:13 AM
  4. One Flat Rate Shipping Table w/ 2nd Day Air and Next Day Air Options
    By Computra in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 13 Feb 2009, 08:16 PM
  5. Free shipping for 2-day, next-day costs?
    By mel150 in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 11 Dec 2008, 11:14 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