function uc_weightquote_ca_predicate in Ubercart 6.2
Implements hook_ca_predicate().
Connect the quote action with the quote event.
File
- shipping/
uc_weightquote/ uc_weightquote.module, line 136 - Shipping quote module that defines a weight-based shipping rate for each product.
Code
function uc_weightquote_ca_predicate() {
$enabled = variable_get('uc_quote_enabled', array());
$predicates = array();
$result = db_query("SELECT mid, title FROM {uc_weightquote_methods}");
while ($method = db_fetch_object($result)) {
$predicates['uc_weightquote_get_quote_' . $method->mid] = array(
'#title' => t('Shipping quote via @method', array(
'@method' => $method->title,
)),
'#trigger' => 'get_quote_from_weightquote_' . $method->mid,
'#class' => 'uc_weightquote',
'#status' => $enabled['weightquote_' . $method->mid],
'#actions' => array(
array(
'#name' => 'uc_quote_action_get_quote',
'#title' => t('Fetch a weightquote shipping quote.'),
'#argument_map' => array(
'order' => 'order',
'method' => 'method',
),
),
),
);
}
return $predicates;
}