Order sort in the store admin area is incorrect (v. 2.55 - 2.94 Build 2)

In the storeadmin area, when viewing orders, if the 'Order By' field is changed from the default New to Old, the sorting may be incorrect. To correct this:

  1. Open the orders.php file in the /storeadmin/ folder.

  2. Add 'else' in front of all but the first if statement in the $salesquery statement:

    1. Change the line:

      if ($ofb == "cost_")

      to:

      else if ($ofb == "cost_")
    2. Change the line:

      if ($ofb == "itemcust_")

      to:

      else if ($ofb == "itemcust_")
    3. Change the line:

      if ($ofb == "qty_")

      to:

      else if ($ofb == "qty_")