The search doesn’t support the post category. I prepared for your solution, but I think it isn’t possible to support post categories in 100% right way without changing the plugin core code. Try it:
add_filter('dgwt/wcas/search_results/output', function ($output) {
$s = get_search_query();
$terms = get_terms(array(
'search' => $s,
'taxonomy' => 'category',
'hide_empty' => true
));
$limit = 5;
if ( ! empty($terms) && is_array($terms)) {
foreach ($terms as $term) {
if ($limit === 0) {
break;
}
array_unshift ($output['suggestions'], array(
'term_id' => $term->term_id,
'taxonomy' => 'product_cat', // You can't change it for category. Frontend doesn't handle other taxonomies
'value' => $term->name,
'url' => get_term_link($term->term_id, 'category'),
'breadcrumbs' => ''
));
$limit--;
}
}
return $output;
});
Best
Damian Góra