[Solved] Woocommerce search results layout, amount results

Hi there,

I’m using layout and loopers to customize my search results for products. I have two problems: 1) my pagination doesn’t work, 2) I can’t seem to go beyond 10 search results.

Page is ‘Archive’, not ‘WC Archive’
Looper providers is set to: s={{dc:query:search_query}}&post_type=product
Looper consumers is set to: ‘all’.

Can you help me with this? Many thanks! :blush:

This is the url for a example search: https://sanopharm.com/?s=magnesium&post_type=product

Hello @Dagaloni,

Thanks for writing in!

The “All” in the items option in the Looper Consumer will be following the global WordPress default settings which is 10 items only. You can adjust this by going to Settings > Reading > Blog pages show at most. Keep in mind that this default setting is used by WordPress throughout the blog index and all the archive pages.

We highly recommend that you use “Many” and insert your desired maximum search results instead so that your blog index and archive pages will display 10 items while your custom search page will return more than the WordPress default setting.

Hope this makes sense.

Thanks Rue! Changing the amount in Settings > Reading > Blog pages show at most worked, however, increasing the value in ‘many’ does not work. I tried to change ‘many’ to 15 but only 10 search results are outputted.

The pagination also doesn’t work.

Hi @Dagaloni,

I have gone through the specified Layout and found that you are using the Query String option of the Looper Provider. In that case, you can mention the posts_per_page attribute with your desired number of result you want to show. The Query String will look like the following.

s={{dc:query:search_query}}&post_type=product&posts_per_page=20

Please remember that currently the pagination and the navigation element works with only a few pre-defined templates.

Thanks

Thank you @tristup, your solution works! And thanks for the explanation about the pagination.

We are delighted to assist you with this.

Cheers!

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