Hi @virteer,
you can set order the results by a certain k2 extra fields, please do as following:
– Open file “jak2_filter.php” in the folder “pluginssearch”.
– Change some lines code of “onSearch” function
function onSearch($text, $phrase = '', $ordering = '', $areas = null)
{
...
/*Add your code here to check k2 extra fields to get order by different fields.*/
/*Change $ordering variable*/
...
}
default check order by of this function:
..
switch ($ordering) {
case 'oldest':
$query.= 'ORDER BY i.created ASC';
break;
case 'popular':
$query.= 'ORDER BY i.hits DESC';
break;
case 'alpha':
$query.= 'ORDER BY i.title ASC';
break;
case 'category':
$query.= 'ORDER BY c.name ASC, i.title ASC';
break;
case 'newest':
default:
$query.= 'ORDER BY i.created DESC';
break;
}
...
Good luck!