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:
[B] // 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: 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) ) {
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!