• Resolved barrycrous

    (@barrycrous)


    Hi, we’ve setup 3 Product Archive templates with the following display conditions:

    1. Shop page + exclude Search Results
    2. Product Categories
    3. Search Results – this template is loaded when results are returned.

    Our shop page is set to show categories only in Customize > Woocommerce > Product Catalogue as we only want to show categories on the shop page.

    But when doing a search with Fibo, the results are always the product categories only. When we change Customize > Woocommerce > Product Catalogue to “Show Products” the results returned are correct.

    We’re using Hello Elementor child theme with minimal additional code and Elementor Pro and I’ve read the https://fibosearch.com/documentation/troubleshooting/the-search-results-page-created-in-elementor-doesnt-display-products/ article.

    Any assistance is much appreciated

    • This topic was modified 3 years, 2 months ago by barrycrous.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi @barrycrous!

    Use this code snippet to hide categories on the search results page:

    /**
     * Hide all product categories on the search results page
     */
    add_filter( 'get_terms', function ( $terms, $taxonomies, $args ) {
    	if ( ! is_admin() && is_search() ) {
    		$terms = [];
    	}
    	return $terms;
    }, 10, 3 );

    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.
    Regards,
    Kris

Viewing 1 replies (of 1 total)
  • The topic ‘Results return product categories’ is closed to new replies.