function uc_flatrate_admin_methods in Ubercart 5
Same name and namespace in other branches
- 6.2 shipping/uc_flatrate/uc_flatrate.admin.inc \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 - Implementation of hook_menu().
File
- shipping/
uc_flatrate/ uc_flatrate.module, line 201 - Shipping quote module that defines a flat shipping rate for each product.
Code
function uc_flatrate_admin_methods() {
$output = '';
$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_currency_format($method->base_rate);
$row[] = uc_currency_format($method->product_rate);
$row[] = l(t('edit'), 'admin/store/settings/quotes/methods/flatrate/' . $method->mid . '/edit');
$rows[] = $row;
}
if (count($rows)) {
$header = array(
t('Title'),
t('Label'),
t('Base rate'),
t('Default product rate'),
t('Actions'),
);
$output .= theme('table', $header, $rows);
}
$output .= l(t('Add a new flat rate shipping method.'), 'admin/store/settings/quotes/methods/flatrate/add');
return $output;
}