Next, you need to get which group the customer belongs to and what the amount is ...
Then, based on these results you need to enable the module when it should show ...
Something line this should work:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}
// bof: test group and order amount
// do not test if in the admin
if (!IS_ADMIN_FLAG) {
global $cart;
$order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
$group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
// display current results to screen for testing comment out to not show
echo 'Customer in group: ' . $group_query->fields['customers_group_pricing'] . ' order amount: ' . $order_total_amount;
// disable for everyone
$this->enabled = false;
// distributor customers_group_pricing 1
if ($group_query->fields['customers_group_pricing'] == 1 && $order_total_amount > 1000) {
$this->enabled = true;
}
// distributor customers_group_pricing 2
if ($group_query->fields['customers_group_pricing'] == 2 && $order_total_amount > 1000) {
$this->enabled = true;
}
// wholesaler customers_group_pricing 3
if ($group_query->fields['customers_group_pricing'] == 3 && $order_total_amount > 150) {
$this->enabled = true;
}
}
// eof: test group and order amount
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {