Zen Cart Logo
Forums / Setting Up Specials and SaleMaker / Disable Freeshipping for select Group Pricing

Disable Freeshipping for select Group Pricing

Views: 5,188

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

Disable Freeshipping for select Group Pricing

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

Re: Disable Freeshipping for select Group Pricing

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

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

nightkidz

New Zenner

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

Re: Disable Freeshipping for select Group Pricing

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

Re: Disable Freeshipping for select Group Pricing

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

Re: Disable Freeshipping for select Group Pricing

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
18 Mar 2015, 12:57 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Disable Freeshipping for select Group Pricing

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

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

nightkidz

New Zenner

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

Re: Disable Freeshipping for select Group Pricing

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

Re: Disable Freeshipping for select Group Pricing

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:

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

nightkidz

New Zenner

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

Re: Disable Freeshipping for select Group Pricing

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.