The first change I made in the "administrator\components\com_hikashop\classes\shipping.php" file and changed the line :
uasort($usable_methods, array($this, "sortShipping"));
To:
//uasort($usable_methods, array($this, "sortShipping"));
Then in the plugins/hikashopshipping/ups/ups.php I added these lines:
function array_sort($array, $on, $type, $order = SORT_ASC){
if(empty($array))
return array();
$new_array = array();
$sortable_array = array();
foreach ($array as $key => $value) {
if($value->shipping_type == $type)
$sortable_array[$key] = $value->shipping_price;
}
switch ($order) {
case SORT_ASC:
asort($sortable_array);
break;
case SORT_DESC:
arsort($sortable_array);
break;
}
foreach ($sortable_array as $k => $v) {
$new_array[$k] = $array[$k];
}
return $new_array;
}
JUST AFTER
AND ADDED:
$new_usable_rates = $this->array_sort($new_usable_rates, 'shipping_price', 'ups', SORT_DESC);
Just before these lines :
foreach($new_usable_rates as $i => $usable_rate) {
if(isset($usable_rate->shipping_price_orig) || isset($usable_rate->shipping_currency_id_orig)){
if($usable_rate->shipping_currency_id_orig == $usable_rate->shipping_currency_id)
$usable_rate->shipping_price_orig = $usable_rate->shipping_price;
else
$usable_rate->shipping_price_orig = $currencyClass->convertUniquePrice($usable_rate->shipping_price, $usable_rate->shipping_currency_id, $usable_rate->shipping_currency_id_orig);
}
$usable_rates[$usable_rate->shipping_id] = $usable_rate;
$cache_usable_rates[$usable_rate->shipping_id] = $usable_rate;
}