You are here

function _commerce_ups_service_list in Commerce UPS 7

Same name and namespace in other branches
  1. 7.2 commerce_ups.module \_commerce_ups_service_list()

Convenience function to get UPS codes for their services.

3 calls to _commerce_ups_service_list()
commerce_ups_commerce_shipping_service_info in ./commerce_ups.module
Implements hook_commerce_shipping_service_info().
commerce_ups_commerce_shipping_service_name in ./commerce_ups.module
commerce_ups_settings_form in ./commerce_ups.admin.inc

File

./commerce_ups.module, line 134

Code

function _commerce_ups_service_list() {
  $services = array(
    // Domestic services
    '03' => array(
      'title' => t('UPS Ground'),
      'description' => t('Ground Delivery'),
    ),
    '01' => array(
      'title' => t('UPS Next Day Air'),
      'description' => t('Next Day Air'),
    ),
    '13' => array(
      'title' => t('UPS Next Day Air Saver'),
      'description' => t('Next Day Air Saver'),
    ),
    '14' => array(
      'title' => t('UPS Next Day Early A.M.'),
      'description' => t('Next Day Early A.M.'),
    ),
    '02' => array(
      'title' => t('UPS 2nd Day Air'),
      'description' => t('2nd Day Air'),
    ),
    '59' => array(
      'title' => t('UPS 2nd Day Air A.M.'),
      'description' => t('2nd Day Air A.M.'),
    ),
    '12' => array(
      'title' => t('UPS 3 Day Select'),
      'description' => t('3 Day Select'),
    ),
    // International services
    '11' => array(
      'title' => t('UPS Standard'),
      'description' => t('International Standard'),
    ),
    '07' => array(
      'title' => t('UPS Worldwide Express'),
      'description' => t('Worldwide Express'),
    ),
    '08' => array(
      'title' => t('UPS Worldwide Expedited'),
      'description' => t('Worldwide Expedited'),
    ),
    '54' => array(
      'title' => t('UPS Worldwide Express Plus'),
      'description' => t('Worldwide Express Plus'),
    ),
    '65' => array(
      'title' => t('UPS Worldwide Saver'),
      'description' => t('Worldwide Saver'),
    ),
  );

  /* Make a unique ID to identify the service by */
  foreach ($services as $key => $service) {
    $service['slug'] = str_replace(' ', '_', drupal_strtolower($service['title']));
    $services[$key] = $service;
  }
  return $services;
}