You are here

function uc_fedex_store_status in FedEx Shipping 7

Same name and namespace in other branches
  1. 5 uc_fedex.module \uc_fedex_store_status()
  2. 6.2 uc_fedex.module \uc_fedex_store_status()
  3. 6 uc_fedex.module \uc_fedex_store_status()

Implementation of Ubercart's hook_store_status().

Lets the administrator know if the FedEx account information has not been filled out.

Return value

Array of error or status messages relating to configuration of FedEx module

File

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

Code

function uc_fedex_store_status() {
  $messages = array();
  $key = variable_get('uc_fedex_user_credential_key', 0);
  $password = variable_get('uc_fedex_user_credential_password', 0);
  $account = variable_get('uc_fedex_account_number', 0);
  $meter = variable_get('uc_fedex_meter_number', 0);
  if ($key && $password && $account && $meter) {
    $messages[] = array(
      'status' => 'ok',
      'title' => t('FedEx Ship Manager'),
      'desc' => t('Information needed to access FedEx Ship Manager has been entered.'),
    );
  }
  else {
    $messages[] = array(
      'status' => 'error',
      'title' => t('FedEx Ship Manager'),
      'desc' => t('More information is needed to access FedEx Ship Manager. Please enter it !link.', array(
        '!link' => l('here', 'admin/store/settings/quotes/methods/fedex'),
      )),
    );
  }
  return $messages;
}