function uc_fedex_weight_markup in FedEx Shipping 7.2
Same name and namespace in other branches
- 5 uc_fedex.module \uc_fedex_weight_markup()
- 6.2 uc_fedex.module \uc_fedex_weight_markup()
- 6 uc_fedex.module \uc_fedex_weight_markup()
- 7 uc_fedex.module \uc_fedex_weight_markup()
Modifies the weight of shipment before sending to FedEx for a quote.
Parameters
$weight: Shipping weight without any weight markup.
Return value
float Shipping weight after markup.
1 call to uc_fedex_weight_markup()
- _uc_fedex_package_products in ./
uc_fedex.module - Packages products into boxes.
3 string references to 'uc_fedex_weight_markup'
- uc_fedex_admin_settings in ./
uc_fedex.admin.inc - Default FedEx Web Services API settings.
- uc_fedex_admin_settings_validate in ./
uc_fedex.admin.inc - Validation handler for uc_fedex_admin_settings form.
- uc_fedex_uninstall in ./
uc_fedex.install - Implements hook_uninstall().
File
- ./
uc_fedex.module, line 626 - FedEx Web Services Rate / Available Services Quote.
Code
function uc_fedex_weight_markup($weight) {
$markup = trim(variable_get('uc_fedex_weight_markup', '0'));
$type = variable_get('uc_fedex_weight_markup_type', 'percentage');
if (is_numeric($markup)) {
switch ($type) {
case 'percentage':
return $weight + $weight * floatval($markup) / 100;
case 'multiplier':
return $weight * floatval($markup);
case 'mass':
return $weight + floatval($markup);
}
}
else {
return $weight;
}
}