I found a place with query. This is ajax.php
// GET ITEMS FOR AUTOCOMPLETE VIA AJAX
if(@$_GET['ajaxItem'] == '1' && @$_GET['sPattern'] <> '') {
$pattern = $_GET['sPattern'];
$max = 12;
$db_prefix = DB_TABLE_PREFIX;
$sql = "
SELECT i.pk_i_id, d.s_title, i.i_price, i.fk_c_currency_code, CONCAT(r.s_path, r.pk_i_id,'_thumbnail.',r.s_extension) as image_url
FROM {$db_prefix}t_item i
INNER JOIN {$db_prefix}t_item_description d
ON d.fk_i_item_id = i.pk_i_id
LEFT OUTER JOIN {$db_prefix}t_item_resource r
ON r.fk_i_item_id = i.pk_i_id AND r.pk_i_id = (
SELECT rs.pk_i_id
FROM {$db_prefix}t_item_resource rs
WHERE i.pk_i_id = rs.fk_i_item_id
LIMIT 1
)
WHERE d.fk_c_locale_code = '" . osc_current_user_locale() . "' AND (s_title LIKE '%" . $pattern . "%' OR s_description LIKE '%" . $pattern . "%') AND b_active = 1 AND b_enabled = 1 AND b_spam = 0
ORDER BY dt_pub_date DESC
LIMIT " . $max . ";
";
I will change it to get what I need. But I dont want to change the query directly in this file, because if you publish some update, my changes will be removed.
How can I change this query by another way. Child theme, hook or something else? Give me please a little example how to do it to keep them after your updates