You are here

function uc_ups_uc_store_status in Ubercart 7.3

Same name and namespace in other branches
  1. 8.4 shipping/uc_ups/uc_ups.module \uc_ups_uc_store_status()

Implements hook_uc_store_status().

Lets the administrator know that the UPS account information has not been filled out.

File

shipping/uc_ups/uc_ups.module, line 286
UPS shipping quote module.

Code

function uc_ups_uc_store_status() {
  $messages = array();
  $access = variable_get('uc_ups_access_license', '') != '';
  $account = variable_get('uc_ups_shipper_number', '') != '';
  $user = variable_get('uc_ups_user_id', '') != '';
  $password = variable_get('uc_ups_password', '') != '';
  if ($access && $account && $user && $password) {
    $messages[] = array(
      'status' => 'ok',
      'title' => t('UPS Online Tools'),
      'desc' => t('Information needed to access UPS Online Tools has been entered.'),
    );
  }
  else {
    $messages[] = array(
      'status' => 'error',
      'title' => t('UPS Online Tools'),
      'desc' => t('More information is needed to access UPS Online Tools. Please enter it <a href="!url">here</a>.', array(
        '!url' => url('admin/store/settings/quotes/settings/ups'),
      )),
    );
  }
  return $messages;
}