You are here

function uc_weightquote_configuration in Ubercart 5

Implementation of hook_configuration().

Connect the weightquote action and event.

File

shipping/uc_weightquote/uc_weightquote.module, line 142
Shipping quote module that defines a shipping rate for each product based on weight.

Code

function uc_weightquote_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_weightquote_methods}");
  while ($method = db_fetch_object($result)) {
    $configurations['uc_weightquote_get_quote_' . $method->mid] = array(
      '#label' => t('Shipping quote via @method', array(
        '@method' => $method->title,
      )),
      '#event' => 'get_quote_from_weightquote_' . $method->mid,
      '#module' => 'uc_weightquote',
      '#active' => $enabled['weightquote_' . $method->mid],
    );
    $configurations['uc_weightquote_get_quote_' . $method->mid] = workflow_ng_configure($configurations['uc_weightquote_get_quote_' . $method->mid], $action);
  }
  return $configurations;
}