If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Specials and SaleMaker / Disable Freeshipping for select Group Pricing

Disable Freeshipping for select Group Pricing

Started by nightkidz on 17 Mar 2015, 10:07 PM · Views: 5,194

Results 1 to 9 of 9
17 Mar 2015, 10:07 PM
#1
nightkidz avatar

nightkidz

New Zenner

Join Date:
Jun 2012
Posts:
9
Plugin Contributions:
0

Post #1 by nightkidz

Hi

Our site currently offer free shipping on order over certain amount. Is there any way to disable the free shipping on customers that are assigned "Discount Pricing Group" - any discount pricing group that is.

It will be greatly appreciated if this can be solved.

Thanks!
Eric

17 Mar 2015, 10:11 PM
#2
ajeh avatar

ajeh

Oba-san

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

Post #2 by ajeh

Are you using the Modules ... Order Total ... Shipping ot_shipping for Free Shipping on Orders >= XX?

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 2015, 10:16 PM
#3
nightkidz avatar

nightkidz

New Zenner

Join Date:
Jun 2012
Posts:
9
Plugin Contributions:
0

Post #3 by nightkidz

Yes, I set it under the shippingorder total module under admin

17 Mar 2015, 10:16 PM
#4
nightkidz avatar

nightkidz

New Zenner

Join Date:
Jun 2012
Posts:
9
Plugin Contributions:
0

Post #4 by nightkidz

yes, exactly

18 Mar 2015, 2:19 AM
#5
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Post #5 by twitchtoo

This should do the trick for the Group Pricing switch:

includes/modules/shipping/freeshipper.php

// bof Twitch Free Shipping Group Pricing Filter - March 17th 2015 - if customer belongs to group pricing do not show this shipping option
$this->enabled = ((MODULE_SHIPPING_FREESHIPPER_STATUS == 'True') ? true : false);
if($_SESSION['customers_group_pricing'] >= '1' && $this->enabled==true) // a group pricing customer
{
$this->enabled=false; // when true - turn this module off
}else{
$this->enabled=true; // when false - keep this module on
}
// eof Twitch Free Shipping Group Pricing Filter - March 17th 2015 - if customer belongs to group pricing do not show this shipping option

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

18 Mar 2015, 12:57 PM
#6
ajeh avatar

ajeh

Oba-san

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

Post #6 by ajeh

If you are controlling this with the Shipping ot_shipping you need to edit two files:
/includes/modules/pages/checkout_shipping/header/header_php.php

and add the code in RED:

      case 'both':
        $pass = true;
        break;
    }

[B]// bof: no Free Shipping for customers in groups
    global $db;
    $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    if ($group_query->fields['customers_group_pricing'] != '0') {
      $pass = false;
    }
// eof: no Free Shipping for customers in groups
[/B]
    $free_shipping = false;
    if ( ($pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
      $free_shipping = true;
    }

and the file:
/includes/modules/order_total/ot_shipping.php

          default:
            $pass = false; break;
        }

[B]// bof: no Free Shipping for customers in groups
    global $db;
    $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    if ($group_query->fields['customers_group_pricing'] != '0') {
      $pass = false;
    }
// eof: no Free Shipping for customers in groups
[/B]
        if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          $order->info['shipping_method'] = $this->title;

What this will do is allow the Shipping ot_shipping to give Free Shipping on orders over XX.XX except to those in a Discount Group ...

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!

18 Mar 2015, 4:09 PM
#7
nightkidz avatar

nightkidz

New Zenner

Join Date:
Jun 2012
Posts:
9
Plugin Contributions:
0

Post #7 by nightkidz

Ajeh:

If you are controlling this with the Shipping ot_shipping you need to edit two files:
/includes/modules/pages/checkout_shipping/header/header_php.php

and add the code in RED:

  case 'both':
    $pass = true;
    break;
}

[B]// bof: no Free Shipping for customers in groups
global $db;
$group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
if ($group_query->fields['customers_group_pricing'] != '0') {
$pass = false;
}
// eof: no Free Shipping for customers in groups
[/B]

$free_shipping = false;
if ( ($pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
$free_shipping = true;
}

> 
> and the file:
> /includes/modules/order_total/ot_shipping.php
> ```
          default:
            $pass = false; break;
        }

[B]// bof: no Free Shipping for customers in groups
    global $db;
    $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    if ($group_query->fields['customers_group_pricing'] != '0') {
      $pass = false;
    }
// eof: no Free Shipping for customers in groups
[/B]
        if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          $order->info['shipping_method'] = $this->title;

What this will do is allow the Shipping ot_shipping to give Free Shipping on orders over XX.XX except to those in a Discount Group ...

Thanks!!! It works like a charm!!! Thank you so much.:clap:

18 Mar 2015, 4:11 PM
#8
ajeh avatar

ajeh

Oba-san

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

Post #8 by ajeh

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

Remember the Zen Cart Team when you are rich and famous! :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!

18 Mar 2015, 4:57 PM
#9
nightkidz avatar

nightkidz

New Zenner

Join Date:
Jun 2012
Posts:
9
Plugin Contributions:
0

Post #9 by nightkidz

Ajeh:

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

Remember the Zen Cart Team when you are rich and famous! :cool:

LOL, YOU will be rich and famous faster than anyone with your skills and acknowledge.

Now I have to disable the sales tax for the discount group too. As we use the discount group for the wholesale accounts that are tax exempted. Can you please advise where I can do the trick?

Thanks in advance.