function commerce_ups_commerce_shipping_service_info in Commerce UPS 7
Same name and namespace in other branches
- 7.2 commerce_ups.module \commerce_ups_commerce_shipping_service_info()
Implements hook_commerce_shipping_service_info().
File
- ./
commerce_ups.module, line 45
Code
function commerce_ups_commerce_shipping_service_info() {
$shipping_services = array();
$available_services = _commerce_ups_service_list();
$selected_services = variable_get('commerce_ups_services', array());
foreach ($selected_services as $id => $val) {
if ($val != 0) {
// if you find a selected one...
$service = $available_services[$id];
$shipping_services[$service['slug']] = array(
'title' => t($service['title']),
'description' => t($service['description']),
'display_title' => t($service['title']),
'shipping_method' => 'ups',
'price_component' => 'shipping',
'callbacks' => array(
'rate' => 'commerce_ups_service_rate_order',
),
);
}
}
return $shipping_services;
}