Hello
I found a solution for this problem on osclass forums.
Add this at the very bottom of your theme functions.php:
Notes:
1.- Take care not to leave blank lines after this.
2.- If your theme functions.php doesn't end with ?> skip first line of my code.
<?php
function cust_refined_pattern_search($params) {
if (@$params['sPattern'] != '') {
$mSearch = Search::newInstance();
$query_elements = (array) json_decode($mSearch->toJson());
$mSearch->addLocale('%');
$mSearch->addGroupBy(DB_TABLE_PREFIX.'t_item.pk_i_id');
if (@$params['sOrder'] != 'i_price') {
$mSearch->addJoinTable(count($query_elements['tables_join']), sprintf("(SELECT fk_i_item_id, MATCH(s_title, s_description) AGAINST('%s') AS relevance FROM %st_item_description) des", $params['sPattern'], DB_TABLE_PREFIX), 'des.fk_i_item_id = '.DB_TABLE_PREFIX.'t_item.pk_i_id', 'INNER' );
$mSearch->order("des.relevance DESC, dt_pub_date", "DESC");
}
}
}
osc_add_hook('search_conditions', 'cust_refined_pattern_search');
function cust_alerts_user_dashboard() {
if (Params::getParam('page') == "user" && Params::getParam('action') == "alerts") {
$webUser = new CWebUser;
$aAlerts = Alerts::newInstance()->findByUser( Session::newInstance()->_get('userId'), false );
$user = User::newInstance()->findByPrimaryKey( Session::newInstance()->_get('userId'));
foreach($aAlerts as $k => $a) {
$array_conditions = (array)json_decode($a['s_search']);
$search = new Search();
$search->setJsonAlert($array_conditions);
if (osc_version() > 361) $search->notFromUser(Session::newInstance()->_get('userId'));
$search->addLocale('%');
$search->addGroupBy(DB_TABLE_PREFIX.'t_item.pk_i_id');
$search->limit(0, 3);
$aAlerts[$k]['items'] = $search->doSearch();
}
$webUser->_exportVariableToView('alerts', $aAlerts);
View::newInstance()->_reset('alerts');
$webUser->_exportVariableToView('user', $user);
}
}
osc_add_hook('before_html', 'cust_alerts_user_dashboard');
?>
Works exactly as I want. Hope it helps someone.
cheers