Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Dec 2011
    Posts
    48
    Plugin Contributions
    0

    Default Re: Restrict shipping module to specific category

    Since categories 15 and 16 are the only ones that cannot ship FedEx (I probably should have mentioned that, sorry), I changed it to this and it appears to work properly. Do you foresee any problems with anything?

    PHP Code:
        if (!IS_ADMIN_FLAG) {
          global 
    $cart;
          
    $chk_cat 0;
          
    $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','15');
          
    $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','16');
          
          if (
    $chk_cat 0) {
            
    $this->enabled false;
          }
        } 
    Thanks again.

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

    Default Re: Restrict shipping module to specific category

    That method can work ...

    You mainly are trying to build a test to see what is in the cart and when that condition is met either allow or not allow the shipping module is shown ...
    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
    Dec 2011
    Posts
    48
    Plugin Contributions
    0

    Default Re: Restrict shipping module to specific category

    Ok, thanks. I'll keep an eye on it in the event I add other non-ground shippable items.

    With my other question about no allowing checkout if the items are mixed, should I ask that in its own thread?

    Thanks again.

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

    Default Re: Restrict shipping module to specific category

    If you build your conditions on when the shipping module can display, if all shipping modules get disabled because of the conditions you test for then the customer will not be able to checkout ...
    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
    Dec 2011
    Posts
    48
    Plugin Contributions
    0

    Default Re: Restrict shipping module to specific category

    Makes sense. Thanks for your help.

  6. #6
    Join Date
    Mar 2012
    Posts
    2
    Plugin Contributions
    0

    Default Re: Restrict shipping module to specific category

    Hi,

    I am using the same FedEx module and was wondering if it is possible to disable the shipping based upon a specific product instead of a specific category?

    I have one product that is light, but because of the dimensions it must be shipped freight. I am hoping to disable FedEx from quoting shipping on that single product and allow the freightquote module to pick it up.

    Any help would be greatly appreciated.

    Thanks,
    Ken

  7. #7
    Join Date
    Dec 2011
    Posts
    48
    Plugin Contributions
    0

    Default Re: Restrict shipping module to specific category

    I'm sure there are other ways, but if you're wanting to do it exactly like I did with my category, you could do the single item like this. Let's assume the product ID is 12.

    PHP Code:
        if (!IS_ADMIN_FLAG) { 
          global 
    $cart
          
    $chk_cat 0
          
    $chk_cat += $_SESSION['cart']->in_cart_check('products_id','12'); 
           
          if (
    $chk_cat 0) { 
            
    $this->enabled false
          } 
        } 
    That should do the trick. But as noted in earlier posts, that will disable FedEx if that item is added even if there are other items that are eligible for FedEx.

    EDIT: Sorry for the original crappy PHP code, I posted it from my iPad and it didn't work so well.
    Last edited by Lanbo; 28 Mar 2012 at 04:57 AM. Reason: iPad posting sucks

 

 

Similar Threads

  1. v150 USPS shipping module...trying to restrict shipping options programmatically
    By ecclescake in forum Addon Shipping Modules
    Replies: 11
    Last Post: 13 Dec 2024, 05:24 AM
  2. v151 Restrict Specific Items from 1st Class Shipping - USPS Module
    By jstevens in forum Addon Shipping Modules
    Replies: 5
    Last Post: 22 Jun 2014, 03:03 AM
  3. Finding way to restrict paypal as payment method for specific item or category?
    By gisco in forum Setting Up Categories, Products, Attributes
    Replies: 20
    Last Post: 29 Apr 2010, 04:38 PM
  4. look for specific module to restrict others on site
    By outlawcat in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Apr 2009, 03:54 PM
  5. Restrict Product Category to specific customers
    By Le Grice in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 20 Mar 2007, 05:33 PM

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