Thread Starter
jbenes
(@jbenes)
Hello,
Just wanted to follow up and see if this is possible. We’d be happy to purchase a Pro license if this is an included capability.
Thank you.
It’s possibile. Here is solutions for Free version:
add_filter( 'dgwt/wcas/search_results/products', function ( $suggestion, $product ) {
if ( ! empty( $suggestion['value'] ) ) {
$categories = $product->getTerms( 'product_cat', 'string' );
if ( ! empty( $categories ) ) {
$suggestion['value'] = $categories . ' - ' . $suggestion['value'];
}
}
return $suggestion;
}, 10, 2 );
You have two ways to add this code to your theme:
- Open the functions.php in your Child Theme and add the code at the end
- or install the Code Snippets plugin and apply this code as a snippet
The solution for the Pro version will be different. If you are interested in the pro version, contact me via https://ajaxsearch.pro/contact/ after purchase. Then I send you solutions that work with the Pro version.
Best
Damian