Extend Product Search In Admin Via Addon

Hello everyone.

I have developed an addon for a client to add a new field to the product. The addon adds an EAN code to the product.

The client also requires that the products can be searched by that code in product search in the right sidebar in admin (dispatch=products.manage).

I have managed to add a new search field, using a hook, but I don't know how to pass that fields value to the search query. Requirement is that I don't alter core files, and to do all of that in addon. Since this is the first addon that i developed for cs-cart and to be honest, I don't quite understand their documentation, and couldn't find much resources on this topic Any guidance would be helpful.

Just to be clear, here is the printscreen of the feature I am talking about

https://prnt.sc/j31z8c

Hello everyone.

I have developed an addon for a client to add a new field to the product. The addon adds an EAN code to the product.

The client also requires that the products can be searched by that code in product search in the right sidebar in admin (dispatch=products.manage).

I have managed to add a new search field, using a hook, but I don't know how to pass that fields value to the search query. Requirement is that I don't alter core files, and to do all of that in addon. Since this is the first addon that i developed for cs-cart and to be honest, I don't quite understand their documentation, and couldn't find much resources on this topic Any guidance would be helpful.

Just to be clear, here is the printscreen of the feature I am talking about

https://prnt.sc/j31z8c

Hello!

If you add name attribute to your search input field, in the fn_get_products you will see your variable in $params array. Then you just need to add the condition like:

if (!empty($params['ean'])) {
    $condition .= db_quote(' AND products.ean LIKE ?l', "%" . trim($params['ean']) . "%");
}

I suggest you to use the get_products hook in the mentioned function (app/functions/fn.catalog.php) to alter $condition variable