I am wondering if it's possible to specify multiple sorting conditions for the order grid in the Admin Panel.
Let's say for example I wanted to sort all orders first by their Bill to Name and then the Purchased On column. Any ideas how that can be done?
I have looked at the code but I got stuck at the Varien_Data_Collection_Db::_setOrder method, with no idea how to implement a solution there:
private function _setOrder($field, $direction, $unshift = false)
{
$this->_isOrdersRendered = false;
$field = (string)$this->_getMappedField($field);
$direction = (strtoupper($direction) == self::SORT_ORDER_ASC) ? self::SORT_ORDER_ASC : self::SORT_ORDER_DESC;
unset($this->_orders[$field]); // avoid ordering by the same field twice
if ($unshift) {
$orders = array($field => $direction);
foreach ($this->_orders as $key => $dir) {
$orders[$key] = $dir;
}
$this->_orders = $orders;
} else {
$this->_orders[$field] = $direction;
}
return $this;
}