Looper Search Results

Themeco,

I’ve created a search result page for my site’s products using Layout Builder and the following Looper Provider code:

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

Everything seems to be working properly, but I have two questions.

Question 1:
Is there a way to make the query more case sensitive or whole word results only? The query is taking portions of words and outputting them as valid results. For example, if I search “Bed”, one of my products (which is not a bed) has the word “hand-rubbed” in it’s content and outputs as a result. The query is recognizing the last three letters of hand-rubbed (bed) as a valid result. “Hand-rubbed” is NOT listed as a product tag and is only a word in the product description.

Question 2:
When a search returns with no results, I am given a blank section. Is there a way to style the blank portion or set a condition to display something upon no results?

Hello Kevin,

Thanks for writing in! Even if you are using a Looper Provider, the search results are still relying on the WordPress search capabilities. Working beyond the capability of the WordPress search results is outside of our scope already. Perhaps these articles can help you:

When there is no search result, you can display a section or a row inside your Looper Provider to display what message or notification you want in that particular section. You can add a condition to the “Looper Provider Output is Empty”.

Hope this helps.

I will try to experiment with the first link. Thank you for directing me to the conditions section, this helped.

Hi Kevin,

Glad that we are able to help you.

Thanks

One final question:

The query string I have above is only producing up to 5 results - even if there are more available. With consumer set to All, it still only produces 5 results. With consumer set to Many - 99, it still only shows 5 results.

Is there something I am doing wrong?

EDIT:
I have changed my string to:

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

It seems to function properly now and displays all the results. However, I still don’t know what was wrong with the original string.

Hi Kevin,

Glad it is functioning properly now.

Thanks

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