Page 20 of 56 FirstFirst ... 10181920212230 ... LastLast
Results 191 to 200 of 552
  1. #191
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    To fix this for the Admin add to the code:
    Code:
            if (IS_ADMIN_FLAG == false) {
              $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','56');
              $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','60');
              if ($chk_case != $_SESSION['cart']->count_contents()) {
                $skip_free = true;
              }
            }
    
    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!

  2. #192
    Join Date
    Jul 2009
    Location
    Crystal Lake, IL
    Posts
    50
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Another new error on the admin page. This time it was on line 46 which is
    Code:
            $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','56');
    Here is that whole section
    Code:
    // class constructor
        function flat() {
          global $order, $db;
    
          $this->code = 'flat';
          $this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE;
          $this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION;
          $this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER;
          $this->icon = '';
          $this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS;
          $this->tax_basis = MODULE_SHIPPING_FLAT_TAX_BASIS;
    
          // disable only when entire cart is free shipping 
          if (zen_get_shipping_enabled($this->code)) { 
              $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false); 
          } 
          // test contents for Cases
           global $cart;  
            $skip_free = false;
            $chk_case = 0;
            $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','56');
            $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','60');
            if ($chk_case != $_SESSION['cart']->count_contents()) {
              $skip_free = true;
            }
          // disable for above categories 
          if ((IS_ADMIN_FLAG == false && $skip_free)) { 
              $this->enabled = false;
          }
    Also, now when I do a test through my site, flat rate seems to just be gone for all categories. Thanks again for all your help.

  3. #193
    Join Date
    Jul 2009
    Location
    Crystal Lake, IL
    Posts
    50
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I added the code that you posted just above my previous post. And it did resolve the admin issue. But Flat Rate is simply disabled for everything now. Here's what I have.
    Code:
    // class constructor
        function flat() {
          global $order, $db;
    
          $this->code = 'flat';
          $this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE;
          $this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION;
          $this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER;
          $this->icon = '';
          $this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS;
          $this->tax_basis = MODULE_SHIPPING_FLAT_TAX_BASIS;
    
          global $cart;
          if (IS_ADMIN_FLAG == false) {
              $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','56');
              $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','60');
              if ($chk_case != $_SESSION['cart']->count_contents()) {
                $skip_free = true;
              }
            }
    Should I put my global $cart up with the other globals ($order, $db;)? Thanks!

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

    Default Re: Different shipping methods for different categories

    To make Flat Rate flat not show when on products from categories_id 56 and 60 are in the cart, use this:
    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);
          }
          // test contents for Cases
           global $cart;
            $skip_free = false;
            $chk_case = 0;
            if (IS_ADMIN_FLAG == false) {
              $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','56');
              $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','60');
              if ($chk_case > 0  && ($chk_case != $_SESSION['cart']->count_contents())) {
                $skip_free = true;
              }
            }
    //echo 'FLAT : ' . $chk_case . '<br>';
          // disable for above categories
          if ((IS_ADMIN_FLAG == false && $skip_free)) {
              $this->enabled = false;
          }
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
    I added one more condition for when the cart doesn't contain anything from categories_id 56 and 60 ...
    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. #195
    Join Date
    Jul 2009
    Location
    Crystal Lake, IL
    Posts
    50
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I think we (I really mean you) have finally got it! My first test didn't come up with an admin error, and seemed to work correctly on the customer side of things too!! You are incredible! Thank you so much. I notice that my per item option is gone too. Is that somehow in that code, or just a strange side effect? I will do a little digging into that issue, but it's not a big issue because I want per item disabled for the same reasons.
    Thanks again!

  6. #196
    Join Date
    Jul 2009
    Location
    Crystal Lake, IL
    Posts
    50
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I think I got it worked out. I forgot that I had the simple version, checking for one category, on the item option. I have updated it to the new code and so far everything seems to be working. Thanks again for all your help!

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

    Default Re: Different shipping methods for different categories

    You are most welcome ... glad that this is working for you now ...
    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!

  8. #198
    Join Date
    Nov 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    is there any way to add more than one id to this code?

    "in_cart_check('master_categories_id','66') > 0) )"

    meaning, I want to add low order fee to category 66, but also to 67,68,69.

    it there any way to do this?

    thanks

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

    Default Re: Different shipping methods for different categories

    If you look at the code, what it is doing is checking two categories based on the master_categories_id in the products table:
    Code:
              $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','56');
              $chk_case += $_SESSION['cart']->in_cart_check('master_categories_id','60');
    and storing the value to:
    $chk_case

    It then checks if that value is the number of items in the cart to indicate that it is the only kind of Products in the cart:
    Code:
              if ($chk_case > 0  && ($chk_case != $_SESSION['cart']->count_contents())) {
    Now what you do with the results of the count is up to 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!

  10. #200
    Join Date
    Nov 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Thanks for your response.
    I'm new to Zen so I'm not sure I gave enough info.
    What I basically want to do it to be able to have only certain categories that add the low order fee.
    So if I have 20 categories and only 5 are going to offer the low order fee, I can add those categories to the code within the file.

    here is what I have now, but it only adds the fee to one category.

    // if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) ) {
    if ( ($pass == true) && ($_SESSION['cart']->in_cart_check('master_categories_id','4')> 0) ) {
    $charge_it = 'true';

    Any help would be greatly appreciated.
    Thanks.

 

 
Page 20 of 56 FirstFirst ... 10181920212230 ... LastLast

Similar Threads

  1. Re: Different shipping methods for different categories
    By kaddie in forum Built-in Shipping and Payment Modules
    Replies: 14
    Last Post: 19 Nov 2010, 04:37 AM
  2. Replies: 2
    Last Post: 27 Oct 2010, 01:45 PM
  3. Different shipping methods for different categories and mixed categories
    By neit in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 10 Aug 2010, 12:20 AM
  4. Separate Shipping Methods for Different Categories
    By MortalWombat in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Jul 2010, 08:57 AM
  5. Different shipping methods for different product types?
    By talisman-studios in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Sep 2008, 04:59 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