Hi,
In that case, you would have to modify the file administrator/components/com_hikashop/classes/filter.php
In it, you'll find the function addFilter with such code:
if($filter->filter_data=='category'){
if(!($infoGet[0] == $filter->filter_namekey && count($infoGet) == 1)){
$categoriesList='';
foreach($infoGet as $cat){
if($cat == $filter->filter_namekey || (int)$cat == 0)
continue;
if(is_numeric($cat)){
$categoriesList.=(int)$cat.',';
}elseif(is_string($cat)){
$cat = explode('::',$cat);
foreach($cat as $selectedCategory){
$selectedCategory = trim($selectedCategory);
if(!empty($selectedCategory))
$categoriesList.=(int)$selectedCategory.',';
}
}
}
if(!empty($categoriesList)){
$categoriesList=substr($categoriesList,0,-1);
$table = 'a';
if($a=='#__hikashop_product AS b'){
$table = 'b';
}elseif($a[0]!='(' && strpos($a,') AS b') && preg_match('#hikashop_product AS ([a-z0-9_]+)#i',$a,$matches)){
$table = $matches[1];
}
$filter->filter_namekey = str_replace('-', '_', $filter->filter_namekey);
$on.=' INNER JOIN '.hikashop_table('product_category').' AS '.$filter->filter_namekey.$i.' ON '.$filter->filter_namekey.$i.'.product_id='.$table.'.product_id AND '.$filter->filter_namekey.$i.'.category_id IN ('.$categoriesList.')';
}
}
}
So you'll want to load the child categories of the categories in the array $categoriesList and add their ids to that array before the INNER JOIN is constructed.
And if you want to make it as an override, you can create a system plugin to load a copy of the modified file after HikaShop is loaded, before HikaShop has to load the filter class (you could load it in onAfterRoute for example).