Forums / Basic Configuration / Remove FLAT Rate Shipping when cart value is over

Remove FLAT Rate Shipping when cart value is over

Views: 889

Results 1 to 4 of 4
16 Mar 2016, 10:48 AM
#1
tilenk avatar

tilenk

New Zenner

Join Date:
Sep 2009
Posts:
37
Plugin Contributions:
0

Remove FLAT Rate Shipping when cart value is over

Hello.

I managed to get another problem for my ZenCart shop :)

I would like the FLAT shipping to disappear from shipping options IF the cart value is over 40$. Currently I have a flat shipping option (costs 3.5) and store pickup (free) available. I also would like to have a FREE SHIPPING for orders over $40. I managed to set it almost perfectly via FreeOptions, but the FLAT is still showing up as an option and is even selected by default, even if the overall value is over $40.

The way I have it set right now in the "Admin > Modules > Shipping"

**flatrate - ON **
Enable Flat Shipping
True

Shipping Cost
3.50

Tax Class
--nič--

Tax Basis
Shipping

Shipping Zone
--nič--

Sort Order
15

freeoptions - ON
Enable Free Options Shipping
True

Shipping Cost
0.00

Handling Fee
0

Total >=
40.00

Total <=

Weight >=

Weight <=

Item Count >=

Item Count <=

Tax Class
--nič--

Tax Basis
Shipping

Shipping Zone
--nič--

Sort Order
1

store pickup - ON
Enable Store Pickup Shipping
True

Pickup Locations
Celje;Ljubljana

Shipping Cost
0.00

Tax Class
--nič--

Tax Basis
Billing

Shipping Zone
--nič--

Sort Order
12

So, how can I get that when the cart value is over $40, I will only have the option of FREE SHIPPING and STORE PICKUP, without "Flat Rate" being shown below ?

16 Mar 2016, 1:16 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Remove FLAT Rate Shipping when cart value is over

You could edit the code for:
/includes/modules/shipping/flat.php

and add the code in RED:

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
      }
[B]// bof: turn off flat for >= $40.00      
if (!IS_ADMIN_FLAG) {
  $chk_total = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices();
  if ($chk_total >= 40.00) {
    $this->enabled = false;
  }
}
// eof: turn off flat for >= $40.00      
[/B]      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {

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!

17 Mar 2016, 1:11 AM
#3
drint avatar

drint

New Zenner

Join Date:
Mar 2016
Posts:
14
Plugin Contributions:
0

Re: Remove FLAT Rate Shipping when cart value is over

the zone rates shipping module is a better way to do this, so i suggest that use zone rates instead and follow the settings below:

  1. Calculation Method -> Price
  2. Sort Order -> 1
  3. Zone 1 Countries -> 00 (default is US,CA)
  4. Zone 1 Shipping Table -> 40:3.5 (means that free shipping if sub-total over 40, or shipping cost is 3.5)

then click the update button; that's all

17 Mar 2016, 1:48 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Remove FLAT Rate Shipping when cart value is over

That would not work correctly with Zone Rates ... you would get the message:

The shipping rate cannot be determined at this 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!]
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!