You could adapt the code to use something from the USPS RateV4 shipping module ...
Edit the file:
/includes/modules/shipping/fedexwebservices.php
and add the code in RED:
Code:
// bof: adapted functions contributed by Marco B
//Quote sorting functions
if (!function_exists('fedex_sort_Alphanumeric')) {
function fedex_sort_Alphanumeric ($a, $b) {
return strcmp($a['title'],$b['title']);
}
}
if (!function_exists('fedex_sort_Price')) {
function fedex_sort_Price ($a, $b) {
$c=(float)$a['cost'];
$d=(float)$b['cost'];
if ($c==$d) return 0;
return ($c>$d?1:-1);
}
}
// eof: adapted functions contributed by Marco B
class fedexwebservices {
Code:
$methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType),
'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))),
'cost' => $cost + (strpos($this->handling_fee, '%') ? ($cost * (float)$this->handling_fee / 100) : (float)$this->handling_fee));
// bof: adapted sort by contributed by Marco B
// Sort the options
define('MODULE_SHIPPING_FEDEX_QUOTE_SORT', 'Price');
//define('MODULE_SHIPPING_FEDEX_QUOTE_SORT', 'Alphanumeric');
if (MODULE_SHIPPING_FEDEX_QUOTE_SORT != 'Unsorted') {
usort($methods,'fedex_sort_'.MODULE_SHIPPING_FEDEX_QUOTE_SORT);
}
// eof: adapted sort by contributed by Marco B
and that should sort the Prices from Low to High ...
Bookmarks