Hi,
Basically, what I'd like to do is to control which shipping and payment modules are displayed depending on

which discount group a customer belongs to. I have a wholesale customer that I've added to discount group with ID 1 in my Customers - Discount Group section of Admin. I have the table shipping module and store pickup modules installed. I'd like to hide both these options if my wholesale customer signs in but display them to everybody else.
I've inserted a function into the table shipping module code that I felt would control this. The PHP

function verify_customer_group() SHOULD return true if the current user is in discount group ID 1 and false

if not. Once I get this working for table shipping, I can apply the function to the store pickup module and potentially, any other module I'd like to hide/display for wholesale customers.
Based on this, I did the following - the file is located in includes/modules/shipping/table.php:

Code:
<?php
/**
 * @package shippingMethod
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: table.php 4184 2006-08-21 03:36:36Z ajeh $
 */
/**
 * Enter description here...
 *
 */
class table extends base {
  /**
   * Enter description here...
   *
   * @var unknown_type
   */
  var $code;
  /**
   * Enter description here...
   *
   * @var unknown_type
   */
  var $title;
  /**
   * Enter description here...
   *
   * @var unknown_type
   */
  var $description;
  /**
   * Enter description here...
   *
   * @var unknown_type
   */
  var $icon;
  /**
   * Enter description here...
   *
   * @var unknown_type
   */
  var $enabled;
  /**
   * Enter description here...
   *
   * @return table
   */


  function table() {
    global $order, $db;

    $this->code = 'table';
    $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_TABLE_TAX_BASIS;
    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
    }

    // function returns true if user is in discount group id 1, false if not.
    function verify_customer_group() {
       global $db;

       $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where 

customers_id = '" . (int)$_SESSION['customer_id'] . "'");
       $group = $group_query->fields['customers_group_pricing'];
       switch($group) {
           case 1:
                return true; // include these groups
       }
       return false;  // exclude all others
    }

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) && (verify_customer_group()) ) {
      $check_flag = false;
      $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . 

MODULE_SHIPPING_TABLE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by 

zone_id");
      while (!$check->EOF) {
        if ($check->fields['zone_id'] < 1) {
          $check_flag = true;
          break;
        } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
          $check_flag = true;
          break;
        }
        $check->MoveNext();
      }

      if ($check_flag == false) {
        $this->enabled = false;
      }
    }
  }
......
Thanks for any help!
Bearaman