Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2009
    Location
    Chicago, IL.
    Posts
    198
    Plugin Contributions
    0

    Default How to kill Table Rate module?

    How can I kill the table rate module when:

    A) the weight of total items is over 300 lbs.

    Or,

    B). When an item from a specific category is added to the cart.

    I will try any suggestions and report back here.

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

    Default Re: How to kill Table Rate module?

    If you do a search on:
    $_SESSION['cart']->in_cart_check
    $this->enabled

    You should find numerous examples of how this can be used to test the cart content ...

    There are also ways to include similar tests for the Order Total to enable/disable based on the $this->enabled
    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!

  3. #3
    Join Date
    Nov 2009
    Location
    Chicago, IL.
    Posts
    198
    Plugin Contributions
    0

    Default Re: How to kill Table Rate module?

    Ajeh, Yes I did find a whole lot of examples and it makes much sense to me now.

    Code:
    if (IS_ADMIN_FLAG == false) {
    // disable if category 38 items are in the cart
    if ($_SESSION['cart']->in_cart_check('master_categories_id','38') > 0) {
    $this->enabled = false;
    }
    }
    I used the above to kill table rate module when there is category '38' in the cart. It works well.

    separate Next Question:

    How do I tweak it in a way that table rate is killed when the weight is above 300 labs?
    Whats the variable for total weight in cart?

    Samar

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

    Default Re: How to kill Table Rate module?

    The weight is in:
    $_SESSION['cart']->weight
    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!

  5. #5
    Join Date
    Nov 2009
    Location
    Chicago, IL.
    Posts
    198
    Plugin Contributions
    0

    Default Re: How to kill Table Rate module?

    Quote Originally Posted by Ajeh View Post
    The weight is in:
    $_SESSION['cart']->weight
    How bad does this look?

    Code:
    if (IS_ADMIN_FLAG == false) {
    // disable if weight over 300lbs
    if ($_SESSION['cart']->weight('weight) > 300) {
    $this->enabled = false;
    }
    }

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

    Default Re: How to kill Table Rate module?

    You have an error in the IF statement:
    Code:
    global $cart;    
    if (IS_ADMIN_FLAG == false) {
    // disable if weight over 300lbs
      if ($_SESSION['cart']->weight > 300) {
        $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!

  7. #7
    Join Date
    Nov 2009
    Location
    Chicago, IL.
    Posts
    198
    Plugin Contributions
    0

    Default Re: How to kill Table Rate module?

    Quote Originally Posted by Ajeh View Post
    You have an error in the IF statement:
    Code:
    global $cart;    
    if (IS_ADMIN_FLAG == false) {
    // disable if weight over 300lbs
      if ($_SESSION['cart']->weight > 300) {
        $this->enabled = false;
      }
    }

    I put the EXACT code in table.php but it didn't work. hahaha what did I miss that I should know 'on the reg'.

    PS: my php skill level is 0.0001 on a scale of 0.0001 to 10 .

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

    Default Re: How to kill Table Rate module?

    I don't know ...

    Taking that exact code, I edit the Table Rate table:
    /includes/modules/shipping/table.php

    and change the code to:
    Code:
        // disable only when entire cart is free shipping
        if (zen_get_shipping_enabled($this->code)) {
          $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
        }
    
    global $cart;
    if (IS_ADMIN_FLAG == false) {
    // disable if weight over 300lbs
      if ($_SESSION['cart']->weight > 300) {
        $this->enabled = false;
      }
    }
        if ($this->enabled) {
    and when the weight in the cart is 300 or less it shows and when 301 or more it does not show ...
    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!

  9. #9
    Join Date
    Nov 2009
    Location
    Chicago, IL.
    Posts
    198
    Plugin Contributions
    0

    Default Re: How to kill Table Rate module?

    Linda, I got it. I had a syntax in 'my' code.

    Thank you so much. The code above works perfectly.


    Samar

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

    Default Re: How to kill Table Rate module?

    You are most welcome ... thanks for the update that this is now working for you after you fixed your syntax error in the 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!

 

 

Similar Threads

  1. v153 How to disable table rate shipping module after certain weight
    By samuxul in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 4 Mar 2015, 04:45 AM
  2. v139f How set Table rate shipping module for differe weight.
    By jagcbe in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 3 May 2012, 07:42 AM
  3. How to specify multiple options within a table-rate shipping module?
    By meeven in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 24 Dec 2010, 12:43 AM
  4. How to kill the table rate module when shipping to Canada?
    By samar777 in forum Addon Shipping Modules
    Replies: 7
    Last Post: 18 Sep 2010, 10:25 PM
  5. Table Rate Module
    By Finchie6 in forum Built-in Shipping and Payment Modules
    Replies: 16
    Last Post: 11 Oct 2009, 09:29 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