Following pages in search results (PRO)

Hello, I have a problem with the search results page on a website that uses woocommerce.
Pagination does not work, ie clicking on the following pages always displays the first 40 search results. Can you have a look please?

Hi @dcheese,

Thanks for reaching out.
The reason behind the issue is the looper and post pagination elements are not connected. I would like to request you go through the following thread on a similar topic.

Hope it will help.
Thanks

I have seen that videos, but I haven’t find a solution. The pagination buttons are corrects I think. The button 2, ie goes to …page/2/?s=casio. If I click on it it seems to go on the right following pages, but isn’t so. The search results remain the same.

Hello @dcheese,

In order to help you with your concern, we need to check your settings. I would request you, please share your details in a secure note. Please provide the following details meanwhile you must troubleshoot a few common issues before we investigate your settings.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts

Thanks

Thank you! The name of the Search results layout is “ricerca”.

Hello @dcheese,

Please be advised that the search results page has its own WordPress loop. You do not need to have a Looper Provider in a search results page. I can see that you have added this query string:
s={{dc:query:search_query}}&post_type=product&posts_per_page=40.

If you want to modify the WordPress search result using that above query, you should do it by using a custom PHP code and add it in the child theme’s functions.php file instead. Perhaps this WPBeginner article can help you.

Once you have deactivated the Looper Provider, the pagination should be working. If you want to increase the number of product items in the search results page, just set it in Cornerstone > Theme Options > WooCommerce > Shop > Posts per Page.

Kindly let us know how it goes.

Thank you Ruenel. I removed the looper provider on the search results page, but now the product search widget no longer works. Whatever I try to search for, no results are returned. Do you have some advice?

Hello @dcheese,

It seems that there are several plugins that are out dated. Your Pro theme is out of date too. Can you please make sure that everything is up to date first? Most of the time, being outdated may cause issues with the WordPress and site’s functions and features. Our latest updates are:

  • Pro theme 5.1.5
  • at least WordPress 5.8
  • PHP 7.4

For more details about the latest supported and compatible version, please check this out:

If you are still having issue after the updates, kindly check this out:

By the way, we highly recommend that you create a staging site and clone your current live site. With the staging site, you can update the staging site first to Pro 5.1.5, double check for any errors or issues and then troubleshoot if there is some incompatibilities and issues. Once everything works perfect, you can proceed to update the live site.

Best Regards.

Thank you so much! It is working now by adding this function:

function searchfilter($query) {
 
    if ($query->is_search && !is_admin() ) {
        $query->set('post_type',array('product'));
    }
 
return $query;
}
 
add_filter('pre_get_posts','searchfilter');

Hi @dcheese,

Glad that it is working now.

Thanks

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