Sort Shipping Methods Based On Cheapest (Least Shipping Cost)

Hello,

Currently, checkout page sorts the shipping methods based on the order it is given in the admin panel However i wish to sort it based on the cost / price, least cost shipping method first. I was able to reach to the below section of code in fn.cart.php however I'm stuck. Can anyone help please? Please do not mention that this requires code work and money, i would appreciate free help for once.

foreach ($product_groups as $key_group => $group) {
if (!empty($group['shippings'])) {
$first_shipping = reset($group['shippings']);
$cart['chosen_shipping'][$key_group] = $first_shipping['shipping_id'];
}
}

Thanks,

Kyle.

Bump, please anyone ? I need this implemented.

Dear All,

Gentle Reminder.

I would really appreciate some help here please.