You are here

function uc_flatrate_admin_methods in Ubercart 6.2

Same name and namespace in other branches
  1. 5 shipping/uc_flatrate/uc_flatrate.module \uc_flatrate_admin_methods()

List and compare all flatrate shipping quote methods.

1 string reference to 'uc_flatrate_admin_methods'
uc_flatrate_menu in shipping/uc_flatrate/uc_flatrate.module
Implements hook_menu().

File

shipping/uc_flatrate/uc_flatrate.admin.inc, line 11
Flat rate shipping method administration menu items.

Code

function uc_flatrate_admin_methods() {
  $output = '';
  $context = array(
    'revision' => 'themed',
    'type' => 'amount',
  );
  $rows = array();
  $enabled = variable_get('uc_quote_enabled', array());
  $weight = variable_get('uc_quote_method_weight', array());
  $result = db_query("SELECT mid, title, label, base_rate, product_rate FROM {uc_flatrate_methods}");
  while ($method = db_fetch_object($result)) {
    $row = array();
    $row[] = check_plain($method->title);
    $row[] = check_plain($method->label);
    $row[] = uc_price($method->base_rate, $context);
    $row[] = uc_price($method->product_rate, $context);
    $row[] = l(t('edit'), 'admin/store/settings/quotes/methods/flatrate/' . $method->mid);
    $row[] = l(t('conditions'), CA_UI_PATH . '/uc_flatrate_get_quote_' . $method->mid . '/edit/conditions');
    $rows[] = $row;
  }
  if (count($rows)) {
    $header = array(
      t('Title'),
      t('Label'),
      t('Base rate'),
      t('Default product rate'),
      array(
        'data' => t('Operations'),
        'colspan' => 2,
      ),
    );
    $output .= theme('table', $header, $rows);
  }
  $output .= l(t('Add a new flat rate shipping method.'), 'admin/store/settings/quotes/methods/flatrate/add');
  return $output;
}