Autocomplete suggestions are divided into groups. For example, product category results appear above products. This can be changed with a code snippet. Create a new fibosearch.php
file in the root directory of your child theme and paste the following code there:
<?php // [SHORTINIT MODE] /** ------------------------------------- * Custom autocomplete headlines order * ------------------------------------- */ add_filter( 'dgwt/wcas/search_groups', function ( $groups ) { $groups['tax_brand']['order'] = 5; $groups['tax_product_tag']['order'] = 20; $groups['post']['order'] = 30; $groups['page']['order'] = 40; $groups['product']['order'] = 100; $groups['tax_product_cat']['order'] = 120; return $groups; } );
ⓘLearn how to add this snippet in the special SHORTINIT mode.
The higher the order
, the lower the given search group will be in the search results. Eg. to move products to the top, replace $groups['product']['order'] = 100;
with $groups['product']['order'] = 1;
.