You are here

function uc_quote_price_sort in Ubercart 5

Same name and namespace in other branches
  1. 8.4 shipping/uc_quote/uc_quote.module \uc_quote_price_sort()
  2. 6.2 shipping/uc_quote/uc_quote.module \uc_quote_price_sort()
  3. 7.3 shipping/uc_quote/uc_quote.module \uc_quote_price_sort()

Callback for uasort().

Sort service rates by increasing price.

3 string references to 'uc_quote_price_sort'
uc_ups_quote in shipping/uc_ups/uc_ups.module
Callback for retrieving a UPS shipping quote.
uc_usps_intl_quote in shipping/uc_usps/uc_usps.module
Callback for retrieving USPS shipping quote to other countries.
uc_usps_quote in shipping/uc_usps/uc_usps.module
Callback for retrieving USPS shipping quote.

File

shipping/uc_quote/uc_quote.module, line 1510
The controller module for fulfillment modules that process physical goods.

Code

function uc_quote_price_sort($a, $b) {
  $ar = $a['rate'];
  $br = $b['rate'];
  if ($ar == $br) {
    return 0;
  }
  else {
    return $ar < $br ? -1 : 1;
  }
}