function theme_uc_usps_option_label in Ubercart 6.2
Same name and namespace in other branches
- 8.4 shipping/uc_usps/uc_usps.theme.inc \theme_uc_usps_option_label()
- 7.3 shipping/uc_usps/uc_usps.theme.inc \theme_uc_usps_option_label()
Theme function to format the USPS service name and rate amount line-item shown to the customer.
Parameters
$service: The USPS service name.
$packages: Package information.
1 theme call to theme_uc_usps_option_label()
- uc_usps_quote in shipping/
uc_usps/ uc_usps.module - Callback for retrieving USPS shipping quote.
File
- shipping/
uc_usps/ uc_usps.module, line 519 - Shipping quote method module that receives quotes from the United States Postal Service via XML web service.
Code
function theme_uc_usps_option_label($service, $packages) {
// Start with USPS logo
$output = theme('image', drupal_get_path('module', 'uc_usps') . '/uc_usps_logo.gif', t('U.S.P.S.'), '', array(
'class' => 'usps-logo',
));
// Add USPS service name, removing any 'U.S.P.S.' prefix.
$output .= preg_replace('/^U\\.S\\.P\\.S\\./', '', $service);
// Add package information
$output .= ' (' . format_plural(count($packages), '1 package', '@count packages') . ')';
return $output;
}