Woocommerce Search in Pro Header Widget Area not working

I have a widget area in my pro header which contains the Woocommerce Product Search.
After entering a search term and hitting enter, it just refreshes the page. It’s not working.

http://146.66.100.120/~traillif/shop/

Hi Jonathan,

Thanks for writing in, but sorry I can’t replicate the issue on my dev site, this could be something on your configuration.

  • Ensure that your Woocommerce is a compatible version (Version Compatibility).
  • Clear all the site caches (plugin, server-side, CDN, and browser’s cache) so that the code from the latest release is always in use. This will help you to avoid any potential errors.
  • Test for a plugin conflict. You can do this by deactivating all third-party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
  • Remove custom Javascript and custom templates (if any).
  • Reset your .htaccess file by renaming it to .htaccess-bak. Then in WP Admin Menu, go to Settings > Permalinks and just click the Save Changes button.

Let us know how it goes,
Cheers!

I’m using Woocommerce 3.4.7
cleared cache
disabled all plugins
no custom JS
Reset .htaccess file.

It’s still not working.

The only thing is that the Woocommerce version compatibility is supposedly 3.4.5 and I’m using 3.4.7 (and now 3.5 has been released but I haven’t upgraded yet).

Any help is appreciated.

Hey There,

I’ve checked the site and I can see the shortcode unrendered on the page which indicates that you have disabled part of the plugin? Could you provide us with your WordPress admin login credentials so I can take a look at this.

Make sure to use the secure note so your login credentials only can be viewed by our staff. Thanks!

I added a secure note to my previous comment.

Hi Jonathan,

It seems to be a redirect and not header related, it works okay in my installation without any issue. And I also tried your header on other pages and it still redirects back to shop page.

Would you mind providing your FTP login credentials in a secure note? I can’t promise any solution but I’ll try the plugin conflict test through FTP first and then the htaccess too.

Thanks!

Attaching credentials here.

Hello @MarketFresh,

I am another staff checking and I can see that the product search redirects to your shop page. This is the normal way which the only difference is that when it redirects to the shop, it should only displays the related products that you were looking for. Judging with the number of plugins installed, I would guess that one of this plugins is causing this issue. We may have the permission to turn off some of the plugins so that we can find out which one is causing this?

Kindly let us know.

Yes, you have permission. Thanks!

Hi Jonathan,

The culprit is the custom code that you added to your child theme’s functions.php,

// Redirect to Custom Shop Home

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

I recommend removing that code, or use another custom code that respect search requests.

Thanks!

Thank you @Rad! That did it.

I made some proper changes to the permalinks that removes the need for this code now.

I really appreciate your help!

In behalf of @Rad, you’re most welcome Jonathan.

Have a nice weekend.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.