Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Turning off "Table Rate" before a certain price

Turning off "Table Rate" before a certain price

Views: 1,690

Results 1 to 11 of 11
30 Apr 2013, 1:54 AM
#1
jmwiley avatar

jmwiley

New Zenner

Join Date:
Apr 2013
Location:
California
Posts:
11
Plugin Contributions:
0

Turning off "Table Rate" before a certain price

I saw the below on another thread, where the table rate is ignored depending on (greater than or less than) a certain price. I was wondering if the same thing can be done for a certain price and if so, can it be easily switched from (greater than or less than) as well?

thank you!

http://www.zen-cart.com/showthread.php?205841-Use-Table-rate-to-a-point-then-ignore&highlight=table+price+range

"So are you saying you want it to turn off on a weight > .25?

If so, you can customize the file:
/includes/modules/shipping/table.php

and in the function quote, add the code in RED:

Code:
// bof: disable shipping module > .25
if ($shipping_weight > .25) {
// skip shipping
} else {
// show shipping
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
'cost' => $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
}
// eof: disable shipping module > .25"

30 Apr 2013, 1:51 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Turning off "Table Rate" before a certain price

This is a new table.php that has features for when to turn OFF the shipping module ...

See if it can manage for you what you are wanting ...

Everything is in the settings for the Rates, so follow:

1 Download this file

2 Edit your current settings and save them to NotePad

3 Uninstall your Table Rate table shipping module

4 Upload this new table.php module to:
/includes/modules/shipping

5 Install and customize

Notice there is a new setting for OFF ...

Try using that for what you need on disabling the Table Rate table shipping module ...

3 May 2013, 4:55 AM
#3
jmwiley avatar

jmwiley

New Zenner

Join Date:
Apr 2013
Location:
California
Posts:
11
Plugin Contributions:
0

Re: Turning off "Table Rate" before a certain price

Thank you SO MUCH for reponding so quickly to my thread, I REALLY appreciate it.

I inserted the "table.zip" file into the store and I noticed the "OFF"

"To terminate quotes use OFF to no longer show this shipping module. To turn off quotes at 10 or more, use 3:8.50,7:10.50,9:15%,10:OFF" - Wonderful, excellent, love it!!

Using shipping modules UP TO a cetain price or weight
However, I was hoping that USPS(the one my dropshipper uses) and/or FedEx(the other one my dropshipper uses), and/or UPS and/or etc can be used for calculating shipping and NOT have the "Table Rate" module show-up until a certain price or weight is in check-out and then ONLY use "Table Rate" mod from then on.

Mild Clarification:
The weight or price determination will be based on my "Table Method" selection that's within the "Table Rate" module.

My example below:
999.99:OFF,1999.00:100.00,3499.00:155.00,4999.00:210.00,6499.00:265.00,7999.00:270.00,8000.00:300.00

What I'm attempting in the line above is to turn off the "Table Rate" for anything priced from $0 to $999.99 (it'd be great if weight had this option as well) and have the other shipping mods calculate shipping within that range of $0 to $999.99. Then I'd like for the other shipping mods to disappear when the price (or weight, respectively) reaches $1,000.00+ and have the "Table Rate" mod take over calcuations from there, due to the heavier weight, larger boxes and high priced ticket items.

THANK YOU SO MUCH AHEAD OF TIME FOR LOOKING AT THIS.

I apologize if the above is messy, it's been a looooonnnnggg week and my brain is moooossh. I realized this when I had to retype some sections, several times. I'm still worried if it makes sense or not.

3 May 2013, 1:41 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Turning off "Table Rate" before a certain price

Unfortunately, OFF is a terminator and once set to OFF, all other settings are ignored ...

If you want to turn off the Table Rate when less than or equal to $999.99, then you would use the code in RED:

    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
    }

[B]// bof: turn off until price > 999.99
    if (!IS_ADMIN_FLAG) {
//echo 'Table  cart total: ' . $_SESSION['cart']->total . ' - ' . ($_SESSION['cart']->total < 999.99 ? 'YES HIDE' : 'NO SHOW') .  '<br>';
      if ($_SESSION['cart']->total < 999.99) {
        $this->enabled = false;
      }
    }
// eof: turn off until price > 999.99
[/B]
7 Oct 2013, 6:56 PM
#5
faze3 avatar

faze3

New Zenner

Join Date:
Jan 2009
Posts:
54
Plugin Contributions:
0

Re: Turning off "Table Rate" before a certain price

Along the same lines as above, I use the table rate as a low cost option for items up to 100g. But I could also do with limiting it's availability over a certain price, say £10.00. Is it possible to restrict by weight and value?

I've currently got the following code inserted to deal with the weight:
// bof: turn off for weight over 100
if (!IS_ADMIN_FLAG) {
global $cart;
if ($_SESSION['cart']->show_weight() > 100) {
$this->enabled = false;
}
}
// eof: turn off for weight over 100

Thanks,

Alan.

PS I'm still using 1.3.8a

7 Oct 2013, 7:08 PM
#6
faze3 avatar

faze3

New Zenner

Join Date:
Jan 2009
Posts:
54
Plugin Contributions:
0

Re: Turning off "Table Rate" before a certain price

Sorry, that should have read "limiting its availability to BELOW a certain price, say £10.00"

7 Oct 2013, 10:35 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Turning off "Table Rate" before a certain price

You could use for the amount:
$_SESSION['cart']->show_total()

7 Oct 2013, 10:43 PM
#8
faze3 avatar

faze3

New Zenner

Join Date:
Jan 2009
Posts:
54
Plugin Contributions:
0

Re: Turning off "Table Rate" before a certain price

Sorry, coding is really not my thing! How would that make the table rate only show for cart contents of less than £10?

7 Oct 2013, 10:45 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Turning off "Table Rate" before a certain price

You are either using for just weight:

if ($_SESSION['cart']->show_weight() > 100) {

for just price:

if ($_SESSION['cart']->show_total()  > 10.00) {

or for either/or:

if ($_SESSION['cart']->show_weight() > 100 || $_SESSION['cart']->show_total()  > 10.00) {
7 Oct 2013, 10:57 PM
#10
faze3 avatar

faze3

New Zenner

Join Date:
Jan 2009
Posts:
54
Plugin Contributions:
0

Re: Turning off "Table Rate" before a certain price

Perfect - thank you so much.

Alan.

7 Oct 2013, 11:13 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Turning off "Table Rate" before a certain price

You are most welcome ... thanks for the update that this is now working for you ... :smile: