Results 1 to 10 of 15

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    44
    Plugin Contributions
    0

    Default Disabling UPS for certain categories

    I need to disable UPSXML for categories 1, 38 and 39. I've read several threads on this and think this is all I need to do, but it doesn't work. Probably a syntax thing. Ideas?

    Add this code to /includes/modules/shipping/upsxml.php. The commented out code is another unsuccessful try.

    Code:
                if ($check_flag == false) {
                    $this->enabled = false;
                }
    // disable if master_categories_id 1 is in the cart
    //      if ($_SESSION['cart']->in_cart_check('master_categories_id','1') > 0) {
    //          $this->enabled = false;
    //      }
    // skip certain categories
          if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','1') > 0) {
            $this->enabled = false;
          }  
          if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','38') > 0) {
            $this->enabled = false;
          }  
          if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 0) {
            $this->enabled = false;
          }  
              }

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

    Default Re: Disabling UPS for certain categories

    If you add below the line:
    Code:
    // skip certain categories
    global $cart;
    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!]
    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
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Disabling UPS for certain categories

    Sorry goober moment ... I think you have the code in the wrong place ...

    Can you move it a little higher up and below the code:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : 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!]
    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. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Disabling UPS for certain categories

    NOTE: in UPSXML the code will probably look like:
    Code:
            $this->enabled = ((MODULE_SHIPPING_UPSXML_RATES_STATUS == 'True') ? true : 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!]
    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
    Jul 2011
    Posts
    44
    Plugin Contributions
    0

    Default Re: Disabling UPS for certain categories

    That's it! Just pasting it higher, above this line makes it work beautifully.

    Code:
              if (($this->enabled == true) && ((int)MODULE_SHIPPING_UPSXML_RATES_ZONE > 0)) {
                $check_flag = false;
    Many thanks Ajeh! You rock.

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

    Default Re: Disabling UPS for certain categories

    You had put your code in a section where the Zone had to be tested but the Zone wasn't tested as there was no Zone set ...

    Having you move it, places it outside of that Zone Test and the results will disable the Zone test from even being looked at ...

    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!]
    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
    Jul 2011
    Posts
    44
    Plugin Contributions
    0

    Default Re: Disabling UPS for certain categories

    Grrrrr! Works great for frozen items in the cart as now it doesn't show the UPS (priced) shipping options when Free is selectable right below it using freeshipper and 0 weight. But put a non-frozen item in the cart and now nothing shows at all, neither regular UPS options or the freeshipper option. Just empty. Going to checkout, the only option is store walkin. That ain't gonna work so I commented it out and UPS shows on frozen items which should be just freeshipper. Hmmm.

    Seems like it should just display normal shipping for categories other than 1, 38 and 39, and show Shipping Included for those categories. Guess it's the combination that's screwing it up. Maybe I need a split category that allows a combination or something. Doesn't sound fun.

    http://www.texastamale.com/store/

 

 

Similar Threads

  1. v138a Disabling COD payment for certain customers
    By moosesoom in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 20 Feb 2014, 04:17 PM
  2. Disabling the links for Top Categories in Side Box
    By Wulf359 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 13 Jan 2009, 05:50 AM
  3. Disabling Image Pop Ups.
    By wmorris in forum General Questions
    Replies: 2
    Last Post: 1 Nov 2008, 07:17 AM
  4. USPS and Disabling Flat Rate for Certain Products
    By accension in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 27 Mar 2008, 08:12 PM
  5. USPS module, disabling a service for certain weights
    By dman76 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 18 Nov 2007, 01:58 AM

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