Viewing 1 replies (of 1 total)
  • Hi @ryter23

    Make WooCommerce search results in right way

    1.?Go to Templates?->?Theme Builder?->?Add new
    2. Create a?Product Archive?page

    3. Add Archive Products and the Archive title widget to your template.

    4. After finishing creating a template, set the condition to Include -> Search results

    That way, the search results page will be created properly. Still doesn’t work?

    Check if you have more than one Product Archive template. 

    If so, open all templates that aren’t “Search Results” and add an extra condition: Exclude -> Search Results

    Note:

    Sometimes excluding “Search Results” from the Shop page still doesn’t work. In such cases, create an empty search.php file in the root of your child theme and paste there the following code. The $template_id variable is the post ID of the Elementor template with WooCommerce search results. You can find this ID on the URL. Go to Templates -> Theme Builder -> Products Archive and open the template with the search results. The URL should be like this https://your-domain.com/wp-admin/post.php?post=100&action=elementor. In this case, the $template_id is 100, but in your case, it will be a different number.

    <?php
    $frontend    = new \Elementor\Frontend();
    $template_id = 100; // Your search results template ID
    echo $frontend->get_builder_content_for_display( $template_id, $with_css = true );

    Regards,
    Kris

Viewing 1 replies (of 1 total)
  • The topic ‘Product Category in Search instead of products’ is closed to new replies.