function uc_flatrate_configuration in Ubercart 5
Implementation of hook_configuration().
Connect the quote action with the quote event.
File
- shipping/
uc_flatrate/ uc_flatrate.module, line 140 - Shipping quote module that defines a flat shipping rate for each product.
Code
function uc_flatrate_configuration() {
$enabled = variable_get('uc_quote_enabled', array());
$configurations = array();
$action = workflow_ng_use_action('uc_quote_action_get_quote', array(
'#label' => t('Fetch a shipping quote'),
));
$result = db_query("SELECT mid, title FROM {uc_flatrate_methods}");
while ($method = db_fetch_object($result)) {
$configurations['uc_flatrate_get_quote_' . $method->mid] = array(
'#label' => t('Shipping quote via @method', array(
'@method' => $method->title,
)),
'#event' => 'get_quote_from_flatrate_' . $method->mid,
'#module' => 'uc_flatrate',
'#active' => $enabled['flatrate_' . $method->mid],
);
$configurations['uc_flatrate_get_quote_' . $method->mid] = workflow_ng_configure($configurations['uc_flatrate_get_quote_' . $method->mid], $action);
}
return $configurations;
}