function uc_weightquote_uc_shipping_method in Ubercart 7.3
Implements hook_uc_shipping_method().
File
- shipping/
uc_weightquote/ uc_weightquote.module, line 161 - Shipping quote module that defines a weight-based shipping rate for each product.
Code
function uc_weightquote_uc_shipping_method() {
$methods = array();
$result = db_query("SELECT mid, title, label, base_rate, product_rate FROM {uc_weightquote_methods}");
foreach ($result as $method) {
$methods['weightquote_' . $method->mid] = array(
'id' => 'weightquote_' . $method->mid,
'module' => 'uc_weightquote',
'title' => $method->title,
'description' => t('!base_rate + !product_rate per !unit', array(
'!base_rate' => uc_currency_format($method->base_rate),
'!product_rate' => uc_currency_format($method->product_rate),
'!unit' => variable_get('uc_weight_unit', 'lb'),
)),
'operations' => array(
'edit' => array(
'title' => t('edit'),
'href' => 'admin/store/settings/quotes/methods/weightquote/' . $method->mid,
),
'delete' => array(
'title' => t('delete'),
'href' => 'admin/store/settings/quotes/weightquote/' . $method->mid . '/delete',
),
),
'quote' => array(
'type' => 'order',
'callback' => 'uc_weightquote_quote',
'accessorials' => array(
$method->label,
),
),
'enabled' => TRUE,
);
}
return $methods;
}