Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2008
    Location
    Roberts Creek BC, Canada
    Posts
    32
    Plugin Contributions
    0

    Default Can I restrict certain shipping modules for certain products?

    I have been searching the forums for info but to no avail.

    I have product categories on my site http://shadoblixfarm.ca
    For most of the categories I want the shipping module (canada post) to be available BUT on the PRESERVES category I wish only the pick up at store option to be shown. Is there a way around this?

    Cheers for any help and suggestions.

    DJ

  2. #2
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Can I restrict certain shipping modules for certain products?

    There's a good thread on this subject, here:

    http://www.zen-cart.com/showthread.p...ory-or-product

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

    Default Re: Can I restrict certain shipping modules for certain products?

    If I order some Blackberry Jelly and then I also order a bunch of Tea and Spices, do I still need to pick up the order at the store?

    From what I see, all Preserves are using master_categories_id 4 ... is this correct?

    If so, you could customize your shipping module with the code:
    Code:
    // bof: turn off shipping module when 1 or more Products are in the cart for master_categories_id 4
      if (!IS_ADMIN_FLAG) {
        // check the count of a specific field
        $chk_cat = 0;
        // check how many Products are in the cart for master_categories_id 4
        $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','4');
        // if any are found turn off the shipping module
        if ($chk_cat > 0) {
          $this->enabled = false;
        }
      }
    // eof: turn off shipping module when 1 or more Products are in the cart for master_categories_id 4
    That code can be added to most any shipping module, just put it below the code similar to:
    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);
          }
    Last edited by Ajeh; 12 Feb 2013 at 05:05 AM. Reason: Fix typo
    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. #4
    Join Date
    Jan 2008
    Location
    Roberts Creek BC, Canada
    Posts
    32
    Plugin Contributions
    0

    Default Re: Can I restrict certain shipping modules for certain products?

    Thanks Ajeh, we will have it stated in the preserves category that they can be ordered online but can only be picked up at the store.

    Would there be a way of setting things that works like this ---> if a customer orders preserves and spices and teas, when they proceed to checkout they are informed that (because of the preserves), they will have to pick up their entire order at the store?

    Your suggested coding above will work just fine if they ONLY order preserves though.

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

    Default Re: Can I restrict certain shipping modules for certain products?

    What shipping methods do you have installed?

    If you add the code that I gave you to the shipping module(s) that you are using (except Store Pickup) and make an order of Tea and Preserves, do you see on the checkout_shipping the text:
    This is currently the only shipping method available to use on this order.
    with just the Store Pickup as the shipping method?
    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. #6
    Join Date
    Jan 2008
    Location
    Roberts Creek BC, Canada
    Posts
    32
    Plugin Contributions
    0

    Default Re: Can I restrict certain shipping modules for certain products?

    Ajeh,

    Currently I have Canada post shipping and pick up at store installed. When I added the above coding to the shipping module and did a test purchase of just preserves, I was still given the option of pick up at store AND canada post shipping. Unless I had installed the coding in the wrong place..... /includes/modules/shipping/item.php

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

    Default Re: Can I restrict certain shipping modules for certain products?

    You should place it below:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_ITEM_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: 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!

  8. #8
    Join Date
    Jan 2008
    Location
    Roberts Creek BC, Canada
    Posts
    32
    Plugin Contributions
    0

    Default Re: Can I restrict certain shipping modules for certain products?

    Ajeh..... just realized it should have been in the canada post shipping module..... so I added the coding there but when I go to checkout with 2 preserves all I get is a blank screen... is the coding in the wrong place in this instance

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

    Default Re: Can I restrict certain shipping modules for certain products?

    Either there is an issue with the new code, or you have white space such as a space(s) or blank line(s) before the starting <?php tag or the ending ?> in the file ...

    Peek in your debug logs in either the /cache or /log directory depending on version of software and see what the error message reads ...
    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!

  10. #10
    Join Date
    Jan 2008
    Location
    Roberts Creek BC, Canada
    Posts
    32
    Plugin Contributions
    0

    Default Re: Can I restrict certain shipping modules for certain products?

    Thanks Ajeh.... working great now..... I had deleted one part of the coding by mistake.

    Cheers, Thanks for your help

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 Can I restrict sales of some products to certain countries?
    By DragonLady in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 31 Dec 2015, 10:02 AM
  2. v150 Restrict certain products to certain postcodes
    By mattys in forum General Questions
    Replies: 9
    Last Post: 20 Jul 2013, 07:27 PM
  3. v139h Can I restrict certain shipping modules for different customers
    By dre in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 26 Mar 2013, 09:06 AM
  4. Can I restrict certain payment methods for certain products?
    By one tall man in forum Built-in Shipping and Payment Modules
    Replies: 27
    Last Post: 6 Apr 2011, 08:40 PM
  5. 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

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