You are here

function uc_fedex_ca_predicate in FedEx Shipping 6.2

Same name and namespace in other branches
  1. 6 uc_fedex.module \uc_fedex_ca_predicate()
  2. 7 uc_fedex.module \uc_fedex_ca_predicate()

Implements hook_ca_predicate().

Connect the FedEx quote Action and Event.

File

./uc_fedex.module, line 142
FedEx Web Services Rate / Available Services Quote.

Code

function uc_fedex_ca_predicate() {
  $enabled = variable_get('uc_quote_enabled', array() + array(
    'fedex_ground' => FALSE,
    'fedex' => FALSE,
    'fedex_freight' => FALSE,
  ));
  $predicates = array(
    'uc_fedex_get_ground_quote' => array(
      '#title' => t('Shipping quote from FedEx Ground'),
      '#trigger' => 'get_quote_from_fedex_ground',
      '#class' => 'uc_fedex',
      '#status' => $enabled['fedex_ground'],
      '#actions' => array(
        array(
          '#name' => 'uc_quote_action_get_quote',
          '#title' => t('Fetch a shipping quote'),
          '#argument_map' => array(
            'order' => 'order',
            'method' => 'method',
          ),
        ),
      ),
    ),
    'uc_fedex_get_quote' => array(
      '#title' => t('Shipping quote from FedEx'),
      '#trigger' => 'get_quote_from_fedex',
      '#class' => 'uc_fedex',
      '#status' => $enabled['fedex'],
      '#actions' => array(
        array(
          '#name' => 'uc_quote_action_get_quote',
          '#title' => t('Fetch a shipping quote'),
          '#argument_map' => array(
            'order' => 'order',
            'method' => 'method',
          ),
        ),
      ),
    ),
    'uc_fedex_get_freight_quote' => array(
      '#title' => t('Shipping quote from FedEx Freight'),
      '#trigger' => 'get_quote_from_fedex_freight',
      '#class' => 'uc_fedex',
      '#status' => $enabled['fedex_freight'],
      '#actions' => array(
        array(
          '#name' => 'uc_quote_action_get_quote',
          '#title' => t('Fetch a shipping quote'),
          '#argument_map' => array(
            'order' => 'order',
            'method' => 'method',
          ),
        ),
      ),
    ),
  );
  return $predicates;
}