Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2008
    Posts
    64
    Plugin Contributions
    0

    Default Disable Flat rate after weight of cart is over a certain amoun

    Hi All,

    Im trying to hide/disable the selection of table rate shipping after the cart reaches a certain limit.

    I could be in the completely wrong place however if i edit the
    includes/modules/shipping/table.php file and add the following code should It hide the table rate if over 500?

    // final check for display of Table Options
    if ($shipping_weight > 500) {
    $this->enabled = false;
    } else {
    $this->enabled = true;
    }

    I have put it after line 62 and it does not come up with errors however does not hide the table rate either...

    My coding skills are almost zero however Im having a go with no luck at the moment..

    Cheers

    Brett

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

    Default Re: Disable Flat rate after weight of cart is over a certain amoun

    $shipping_weight is not defined at line 62 ... so it is 0 ...

    Try instead to use:
    PHP 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
    Mar 2008
    Posts
    64
    Plugin Contributions
    0

    Default Re: Disable Flat rate after weight of cart is over a certain amoun

    Linda you are a star..

    Works like a treat...

    One very happy zenner here...

  4. #4
    Join Date
    May 2007
    Posts
    47
    Plugin Contributions
    0

    Default Re: Disable Flat rate after weight of cart is over a certain amoun

    Wow thanks at last Linda.

    I have been asking this for weeks but maybe you didnt understand me.

    Thanks, it works a treat.

    Mick

  5. #5

    Default Re: Disable Flat rate after weight of cart is over a certain amoun

    Quote Originally Posted by brettw View Post
    Hi All,

    Im trying to hide/disable the selection of table rate shipping after the cart reaches a certain limit.

    I could be in the completely wrong place however if i edit the
    includes/modules/shipping/table.php file and add the following code should It hide the table rate if over 500?

    // final check for display of Table Options
    if ($shipping_weight > 500) {
    $this->enabled = false;
    } else {
    $this->enabled = true;
    }

    I have put it after line 62 and it does not come up with errors however does not hide the table rate either...

    My coding skills are almost zero however Im having a go with no luck at the moment..

    Cheers

    Brett
    Quote Originally Posted by Ajeh View Post
    $shipping_weight is not defined at line 62 ... so it is 0 ...

    Try instead to use:
    PHP 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;


    Hi Linda,

    What is the correct syntax if i replace the 500 with a set of zip codes or zones? I have this problem with shipping modules when I ship to one zip code area, 2 shipping modules show up which is not what i wanted to be. I want only 1 shipping module to appear during checkout and the rest should be hidden.

    Hope you could help me on this. Thanks a lot.

    Francis

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

    Default Re: Disable Flat rate after weight of cart is over a certain amoun

    DrByte recently wrote up some zip code syntax for testing that you might what to search for ... or perhaps someone recalls where that pesky thread is hidding ...
    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
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Disable Flat rate after weight of cart is over a certain amoun

    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

    Default Re: Disable Flat rate after weight of cart is over a certain amoun

    Hello Linda

    Thanks for your fast reply.. You know i have tried it already and it worked with the free shipper. Will it work with the other shipping method? I tried tweaking it already but maybe because Im not so famliar with Php i didnt get the best result. how about if i want to call the zone? what is the syntax for that?

    Thanks for your time. I'll get back to you later.

    Francis

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

    Default Re: Disable Flat rate after weight of cart is over a certain amoun

    The same code can be adapted for just about anything ... just take your time ...
    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. How do I - Flat rate shipping up to a certain weight
    By jjj0923 in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 24 Jan 2012, 12:59 AM
  3. Enable Flat Rate/Disable Zone over certain amount
    By mommyslilmonkey in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 21 May 2010, 08:50 AM
  4. Disable free shipping over a certain weight
    By jameswilson in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 20 Jul 2009, 07:43 PM
  5. Flat rate or similar module to only display when over a certain weight?
    By sam_m in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 3 Dec 2008, 12:36 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