Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Built-in Shipping and Payment Modules / Disable Flat rate after weight of cart is over a certain amoun

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

Locked
This thread is locked. New replies are disabled.
4 Apr 2008, 12:49 AM
#1
brettw avatar

brettw

New Zenner

Join Date:
Mar 2008
Posts:
64
Plugin Contributions:
0

Post #1 by brettw

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

6 Apr 2008, 2:56 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

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

Try instead to use:

// 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!]
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 Apr 2008, 11:27 AM
#3
brettw avatar

brettw

New Zenner

Join Date:
Mar 2008
Posts:
64
Plugin Contributions:
0

Post #3 by brettw

Linda you are a star..

Works like a treat...

One very happy zenner here...:clap:

15 Apr 2008, 3:15 AM
#4
pazaz avatar

pazaz

New Zenner

Join Date:
May 2007
Posts:
47
Plugin Contributions:
0

Post #4 by pazaz

Wow thanks at last Linda.

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

Thanks, it works a treat.

Mick

7 Mar 2009, 5:18 PM
#5
charlz71 avatar

charlz71

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

Post #5 by charlz71

brettw:

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

Ajeh:

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

Try instead to use:

// 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
7 Mar 2009, 6:00 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #6 by ajeh

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 ... :cool:

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!

7 Mar 2009, 6:02 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #7 by ajeh

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!

7 Mar 2009, 7:06 PM
#8
charlz71 avatar

charlz71

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

Post #8 by charlz71

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

7 Mar 2009, 7:38 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #9 by ajeh

The same code can be adapted for just about anything ... just take your time ... :smile:

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!