You are here

function theme_uc_fedex_option_label in FedEx Shipping 7.2

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

Formats the customer-facing FedEx service name and rate amount line-item.

Parameters

$variables: Associative array containing information needed to theme a quote. Contains two keys:

  • service: The FedEx service name.
  • packages: Package information.
1 theme call to theme_uc_fedex_option_label()
uc_fedex_quote in ./uc_fedex.module
Callback for retrieving a FedEx shipping quote.

File

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

Code

function theme_uc_fedex_option_label($variables) {
  $service = $variables['service'];
  $packages = $variables['packages'];

  // Start with FedEx logo.
  $output = theme('image', array(
    'path' => drupal_get_path('module', 'uc_fedex') . '/uc_fedex_logo.gif',
    'alt' => 'FedEx logo',
    'title' => '',
    'attributes' => array(
      'class' => 'fedex-logo',
    ),
  ));

  // Add FedEx service name, removing the first six characters
  // (== 'FedEx ') because these replicate the logo image.
  $output .= substr($service, 6);

  // Add package information.
  $output .= ' (' . format_plural(count($packages), '1 package', '@count packages') . ')';
  return $output;
}