Autocomplete suggestions are divided into groups. For example, product category results appear above products. How to change this?
- Create a new
fibosearch.php
file in the root directory of your child theme - Paste the following code into this file:
<?php /** ------------------------------------- * Custom autocomplete headlines order * ------------------------------------- */ add_filter( 'dgwt/wcas/search_groups', function ( $groups ) { $groups['tax_brand']['order'] = 5; $groups['tax_product_cat']['order'] = 120; $groups['tax_product_tag']['order'] = 20; $groups['post']['order'] = 30; $groups['page']['order'] = 40; $groups['product']['order'] = 100; return $groups; } );
3. Change the priorities. If you want to display products under categories, change $groups['product']['order'] = 100;
to $groups['product']['order'] = 3;