Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2014
    Location
    Florida
    Posts
    39
    Plugin Contributions
    0

    Default Hide table rate shipping under a certain weight

    Good evening, I'm trying to accomplish pretty much exactly what was done in this thread here:

    https://www.zen-cart.com/showthread....-certain-amoun

    Unfortunately, that thread is rather old, so the line 62 doesn't appear to even remotely be the right place to put that little snippet of code. If I want to hide the table rate shipping for orders over a certain weight, will this snippet still work for version 1.5.5 and if so, where is the best place in table.php to put it?

    Thanks!

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

    Default Re: Hide table rate shipping under a certain weight

    Put this code on the blank line of 63 and see if that works for you ...
    Code:
    // final check for display of Table Options 
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() > 500) { 
      $this->enabled = false; 
    } else { 
      $this->enabled = 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: 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
    Jan 2014
    Location
    Florida
    Posts
    39
    Plugin Contributions
    0

    Default Re: Hide table rate shipping under a certain weight

    Quote Originally Posted by Ajeh View Post
    Put this code on the blank line of 63 and see if that works for you ...
    Code:
    // final check for display of Table Options 
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() > 500) { 
      $this->enabled = false; 
    } else { 
      $this->enabled = true; 
    }  
    
    That doesn't seem quite right to me, that's right in the middle of this:

    Code:
      /**
    
       * Enter description here...
    
       *
    
       * @var unknown_type
    
       */
    ** In fact, that definitely won't work because it's inside the commented out section, so the enter block just becomes a comment.

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

    Default Re: Hide table rate shipping under a certain weight

    You should place it below this code:
    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);
        }
    which ends on line 62 ...
    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
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide table rate shipping under a certain weight

    NOTE: on line numbers, perhaps your file is double spaced ...
    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 2014
    Location
    Florida
    Posts
    39
    Plugin Contributions
    0

    Default Re: Hide table rate shipping under a certain weight

    Quote Originally Posted by Ajeh View Post
    You should place it below this code:
    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);
        }
    which ends on line 62 ...
    That worked. Though I'm not sure what I was doing wrong formatting wise, when I left the comment, it turned the entire block into a comment for some reason. I guess because there wasn't a hard return there. I couldn't quite figure out how to get one there.... anyway, once I removed it the comment, it worked. Thank you very much for your help.

  7. #7
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Hide table rate shipping under a certain weight

    Quote Originally Posted by Ajeh View Post
    You should place it below this code:
    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);
        }
    which ends on line 62 ...
    I'm trying this on 1.5.6 (under the lines that are available for customization - 215) and it doesn't work. Is the code the same for that version?

    I think the table module should not give a $0 value if I stop on a certain level. So if I have a table that goes up to 3.7lbs. it shouldn't display $0 shipping if the cart hast 4 pounds in it. Am I doing something wrong?
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  8. #8
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Hide table rate shipping under a certain weight

    Quote Originally Posted by ideasgirl View Post
    I'm trying this on 1.5.6 (under the lines that are available for customization - 215) and it doesn't work. Is the code the same for that version?

    I think the table module should not give a $0 value if I stop on a certain level. So if I have a table that goes up to 3.7lbs. it shouldn't display $0 shipping if the cart hast 4 pounds in it. Am I doing something wrong?
    What code has been attempted to be added below the lines in the previous post? When say doesn't work, what is happening?
    Also what you're saying is that basically the table shipping method should never provide a free shipping option to select?
    There hasn't been much changed of the default shipping methods other than filling in gaps to prevent php notices and issues detected by newer php versions.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Hide table rate shipping under a certain weight

    What code has been attempted to be added below the lines in the previous post?
    The code that Linda provided.

    When say doesn't work, what is happening?
    There's no change. No errors, but module continues behaving the same way.

    Also what you're saying is that basically the table shipping method should never provide a free shipping option to select?
    Correct. If the last weight you have in your table (if you are doing it by weight), is 3.7:15, then if you have an order of 4.1#, the table quote is $0, which should be null, or not appear at all because is not available. The system is saying that if is 4.1# is free, which is not true.
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,690
    Plugin Contributions
    123

    Default Re: Hide table rate shipping under a certain weight

    Quote Originally Posted by ideasgirl View Post
    I'm trying this on 1.5.6 (under the lines that are available for customization - 215) and it doesn't work. Is the code the same for that version?

    I think the table module should not give a $0 value if I stop on a certain level. So if I have a table that goes up to 3.7lbs. it shouldn't display $0 shipping if the cart hast 4 pounds in it. Am I doing something wrong?
    This is how these modules work. If your configuration is (say)

    3.7:10

    Then it will charge $10 for up to 3.7 pounds, and then 0 after that.

    If you want it to not be valid after that, you have to add logic, like what Ajeh suggested.

    // final check for display of Table Options
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() > 3.7) {
    $this->enabled = false;
    } else {
    $this->enabled = true;
    }
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 1 of 2 12 LastLast

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. v151 Offering Free Shipping over a certain amount and under a certain weight
    By jimmie in forum Addon Shipping Modules
    Replies: 0
    Last Post: 17 Aug 2013, 10:58 PM
  3. Table Rate - weight certain items no ship method
    By kellan4459 in forum Built-in Shipping and Payment Modules
    Replies: 21
    Last Post: 31 Jul 2009, 06:26 AM
  4. How to Offer Free SHipping over a Certain $$ AND Under Certain Weight
    By Jeff_Mash in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 31 Aug 2007, 06:00 PM
  5. Hide shipping method if order is over a certain weight?
    By Danielle in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 10 Jul 2007, 06:24 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