I'm trying to show products that are in X and are also in Y categories. Not all products in X and all products in Y.

Low kindly replied suggesting adding "require_all" to the results tag. This works a charm, but only seems to work a charm when there is more than 1 category in the search query.

Search form:



        {if group_start}
            <ul class="list-horizontal list-pill border pad mobile-no-display">
                <li class="title">

                <a href="#" class="custom-checkbox{if "{cat_id}" IN ({low_search_category})} active{/if}" data-filter-desktop="filter-{cat_group_id}" data-value="{cat_id}">
                    <input type="checkbox" name="category[]" value="{cat_id}"{if "{cat_id}" IN ({low_search_category})} checked="checked"{/if}>


        {if group_end}


    <ul class="list-horizontal list-pill pad">
        <li class="title-offset">
            <input type="submit" class="button large" id="filter-button" value="Update Results">
            <a href="{site_url}index.php/{prv_template_group}" class="button grey adjust">Clear Filter</a>


Filter template:


    {if low_search_no_results}






            <div class="section pad-b">

                <div class="section-container">

                    <div class="center">

                            <a href="{pagination_url}" class="pagination-arrow prev"></a>

                        <ul id="pagination-numbers">
                                <li class="{if current_page}active{/if}">
                                    <a href="{pagination_url}">

                            <a href="{pagination_url}" class="pagination-arrow net"></a>







Any ideas why this is happening?

  • What does Not all products in X and all products in Y mean? Do you have a screenshot of (or link to) the form?
    – Low
    Oct 29, 2014 at 10:49
  • Also, since you're not using the Keywords filter, you don't need the collection="" parameter (which shouldn't be set on the Form tag in the first place).
    – Low
    Oct 29, 2014 at 10:50
  • @Low I mean, for example i want it to show all products that belong to BOTH X and Y. I don't want it to show all products that are in X and all products that are in Y. Which is why I used the require all. (X & Y are the categories) I'll drop the collection parameter.
    – Jason Mayo
    Oct 29, 2014 at 11:13
  • Using require_all will change category="X|Y" to category="X&Y", so showing entries that belong to both X and Y. But I'm guessing (by the template code) you're outputting categories from multiple groups. Are you sure X and Y don't refer to groups? So you're looking for (X1 or X2) and (Y1 or Y2)?
    – Low
    Oct 29, 2014 at 11:24
  • @Low Yeah thats how I want it, but for example if I only choose X, and update the filter it shows No Results. Even though there is... Thats the problem really. X & Y are the category ID's (In the first block of code at the top)
    – Jason Mayo
    Oct 29, 2014 at 11:52

1 Answer 1


Took a look and saw you were using the same fields twice: once for mobile, once for desktop. One of those would be hidden based on User Agent, but the checkboxes would be checked anyway, as they were still in the DOM.

That means checking one checkbox would actually check 2, resulting in a parameter like category="1&1", which triggered the No Results.

Removing the hidden fields from the DOM solved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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