function uc_usps_shipping_method in Ubercart 5
Same name and namespace in other branches
- 6.2 shipping/uc_usps/uc_usps.module \uc_usps_shipping_method()
Implementation of Übercart's hook_shipping_method().
File
- shipping/
uc_usps/ uc_usps.module, line 165 - Shipping quote method module that receives quotes from the United States Postal Service via XML web service.
Code
function uc_usps_shipping_method() {
$enabled = variable_get('uc_quote_enabled', array());
$weight = variable_get('uc_quote_method_weight', array(
'usps' => 0,
'usps_intl' => 1,
));
$methods = array(
'usps' => array(
'id' => 'usps',
'title' => t('U.S. Postal Service'),
'quote' => array(
'type' => 'small_package',
'callback' => 'uc_usps_quote',
'accessorials' => _uc_usps_services(),
),
'enabled' => $enabled['usps'],
'weight' => $weight['usps'],
),
'usps_intl' => array(
'id' => 'usps_intl',
'title' => t('U.S. Postal Service (Intl.)'),
'quote' => array(
'type' => 'small_package',
'callback' => 'uc_usps_intl_quote',
'accessorials' => _uc_usps_intl_services(),
),
'enabled' => $enabled['usps_intl'],
'weight' => $weight['usps_intl'],
),
);
return $methods;
}