• Resolved andy35

    (@andy35)


    Hi!

    Thank you for your awesome plugin. I have a problem, that I’m unable to solve it by myself.

    I installed FiboSearch to my client’s web shop (using Divi-theme) to search products. The ajax-results are displaying as it should, so no problems there. But when the user presses enter or clicks ‘Display all products’ after the suggested products(search results) it redirects to the front page. There’s no POST arguments (like ?s=search+words ) or anything. The search result template has been set in Divi-theme and the WordPress’s/WooCommerce’s “vanilla” search form is working properly.

    Can you please help to solve this issue.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Maybe there is a conflict with one of your plugins or theme.

    The best approach would be to deactivate plugins one by one and check if the issue still occurs after each deactivation. Also, try to switch your theme to e.g. Storefront, and check if the issue may be related to the theme.

    This will help me determine if it’s not a compatibility issue and which plugin is the cause.

    Best regards,
    Clint

    Plugin Author Damian Góra

    (@damian-gora)

    I checked your redirection trace and you have the following pattern:

    https://lapinpollonpaja.fi/?s=test&post_type=product&dgwt_wcas=1
    REDIRECT 302 ->
    https://lapinpollonpaja.fi

    Probably one of your plugins does it as Clint mentioned above. It may occur also by wrong rules in the .htaccess file or by custom snippet. Did you add some custom rules to .htaccess or write some snippets that use redirects?

    This bug isn’t directly related to our plugin. The same redirection exists for URL https://lapinpollonpaja.fi/?s=test&post_type=product. This URL is a native WordPress search results page URL without the FiboSearch engine.

    You have to find a plugin, a .htaccess rule, or a custom code that makes this wrong redirection and fix it.

    To check redirect trace I used https://wheregoes.com tool.

    Thread Starter andy35

    (@andy35)

    Hi Clint and Damian!

    Thank you for your response. It indeed seems to be a redirect issue. I found out that the problem occurs when the search has the parameter post_type=product. Without it the search results are displaying fine.

    I’m not the original developer of the website and I don’t have the FTP credentials, so I can’t read the .htaccess file. I presume there would be some explanations of redirects, if those are done by some plugin. Now I’m waiting my client to send me FTP credentials so I can investigate this further.

    But it’s certain that this is not related to your plugin so you can mark this as solved. For now it seems that this is related to Divi theme (or it’s child theme “Wardrobe for Divi”). I switched to another theme and the problem didn’t occur.

    I’ll investigate further and if I find the source of the issue, I’ll post it here. It may help you guys or other Divi users. Thank you for your help.

    Thread Starter andy35

    (@andy35)

    I found the issue causing this problem. This is for Damian, Clint and all who are facing this same problem.

    The issue was a code snippet that was in Divi’s child theme “Wardrobe for Divi”. In child theme’s functions.php file had the following code:

    function custom_shop_page_redirect() {
        if( is_shop() ){
            wp_redirect( home_url( '/' ) );
            exit();
        }
    }
    add_action( 'template_redirect', 'custom_shop_page_redirect' );

    What this suppose to do is that it redirects the common shop page domain.com/shop (displaying all products) to front page. The problem is that it also affects to search result page, which is filtered only to products.

    First workaround for this is to remove the whole snippet. If you still want to redirect the common shop page, another workaround is to edit the if-statement line to be this:
    if( is_shop() && ! is_search() ) {

    I didn’t design the client’s web shop (I’m just modifying it), so I don’t know if this code snippet is originally there or did the client’s web shop developer add it. So I also don’t know if the original web shop developer need to be slapped on the back of the head or the child theme’s developers. It took me 6-8 hours to solve this.

    Hope this helps someone.

    • This reply was modified 3 years, 7 months ago by andy35. Reason: spell correcting
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“Show all results” leads to the front page’ is closed to new replies.