You are here

function uc_ups_store_status in Ubercart 5

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

Implementation of Übercart's hook_store_status().

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

File

shipping/uc_ups/uc_ups.module, line 210
Shipping quote module that interfaces with www.ups.com to get rates for small package shipments.

Code

function uc_ups_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/methods/ups'),
      )),
    );
  }
  return $messages;
}