Hello Jerome.
When I tried to do a plugin based on your explanation I found several problems and I changed the approach to my problem.
Instead of doing a search plugin, I add a custom field to my product table in order to do a filter based in this custom field. Then, I developed a product plugin based on "onBeforeProductCreate" and "onBeforeProductUpdate" triggers, in wich I look for authors categories, and concatenate its "category_name" fields saving this value in my custom field as you can see in next code:
function onBeforeProductCreate($productData, $do){
$autores='';
$primero=true;
foreach ($productData->categories as $categoria){
$class = hikashop_get('class.category');
$cate = $class->get((string) $categoria);
if ($cate->category_parent_id == JText::_('CAT_AUTORES')){
if ($primero){
$autores=$autores.$cate->category_name;
$primero=false;
}else{
$autores=$autores.'; '.$cate->category_name;
}
}
}
$productData->autores=$autores;
return true;
}
It works perfectly when I create or modify a product in the backend, but when I import products from a CSV file, it doesn't work.
My question:
Is there any trigger that I can use in my plugin to do the same operation when imports products?
Thanks in advance