0

I am using expresso store:search tag in a page and I am submitting a price range (min/max) to the tag as follows:

{exp:store:search channel="products" search:price:min="{post:min_price}" search:price:max="{post:max_price}" category="{segment_category_ids}" paginate='bottom' dynamic_parameters="orderby|limit|sort"}

There is a lot going on in this I know, but it does work - to a point. When I do a search for a combination that doesn't exist (say there is nothing in that price range) I get a blank page because there are no entries associated.

My question is, does store:search have a no_results tag pair? And if so, how is it implemented? I looked through the documentation and in here, but have found nothing to direct me and it seems like it should be part of a search tag by default.

0

The Store search tag is basically a wrapper for the channel entries tag pair with the ability to search Store specific functionality.

So you would want to do something along the lines of:

{exp:store:search channel="products" search:price:min="{post:min_price}" search:price:max="{post:max_price}"}

{!-- this will show if their are entries --}
 {title} - {price} - {your_custom_fields} 

 {if no_results}
  There are no items for this search.
 {/if}

{/exp:store:search}

So any tags you would use in the channels entries tag pair should be available in your search tag pair.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.