• Resolved alantygel

    (@alantygel)


    Hi,

    When I type a keyword in the FiboSearch bar, it show the correct results in the correct order (i.e., first results contain the keyword in title). However, when a user press enter, it get to the search results page, where the same results shown in the search bar are presented, however ordered differently.

    Example: https://imgur.com/a/jx5rDuq

    If I disable fibo, the default woocommerce search results page shows the results in the correct order.

    How can I solve this?

    best,

    alan

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Kris

    (@c0nst)

    Hi @alantygel!

    This is because Elementor controls your search results page. Follow the below tutorial to make WooCommerce search results in the 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

    Sometimes excluding “Search Results” from the Shop page still doesn’t work. In such cases, create an empty?fibosearch-search-results.php?file in the root of your child theme and paste the following code.

    <?php
    get_header( 'shop' );
    $frontend = new \Elementor\Frontend();
    $template_id = 100; // Your search results template ID
    echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, true );
    get_footer( 'shop' );

    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, there?$template_id?is?100, but in your case, it will be a different number.

    After creating this file, use the below snippet to force Elementor to use the newly created template. Open the?functions.php?in your child theme, add the code at the end, or install the?Code Snippets?plugin and apply it as a snippet.

    <?php
    add_filter( 'template_include', function ( $template ) {
    if ( isset( $_GET['dgwt_wcas'] ) ) {
    $search_template = locate_template( 'fibosearch-search-results.php' );
    if ( file_exists( $search_template ) ) {
    return $search_template;
    }
    }
    return $template;
    }, PHP_INT_MAX - 1 );

    Regards,
    Kris

    Thread Starter alantygel

    (@alantygel)

    Hi,

    Thanks for your answer.

    Unfortunately, I followed all the steps but my results page is still showing in a different order.

    I have only one Product Archive template, where I added the search results. Furthermore, I double checked that fibosearch-search-results.php is being called, and it really is. Changing the template ID, for example, leads to an empty page.

    What else can I check now?

    Plugin Support Kris

    (@c0nst)

    Hi @alantygel.

    If you managed to display the content in the fibosearch-search-results.php file, now ensure the loaded template ID is correct and contains the Product Archives element from Elementor.

    If the above configuration is correct, a white page may indicate a WordPress error. Let’s check this. Please:

    1. Add the following constants to your wp-config.php file, right before the /* That's all, stop editing! Happy publishing. */ line:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );

    2. Trigger the error, so that it gets logged (enter the search results page).
    3. Open the file with logs: wp-content/debug.log.
    4. Check the logs for any fatal errors.
    5. Remove the constant added in point 1 and remove the wp-content/debug.log file.

    Regards,
    Kris

    Thread Starter alantygel

    (@alantygel)

    Hi,

    Thanks for your answer. As I said, the blank page appears only if I set a wrong template ID. Setting the correct ID, leads me again to the search results page with the wrong order.

    Apparently the problem was due to an incompatibility with relevansi. Each plugin alone works fine, both activated together result in the above described problem.

    best,

    alan

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.