1

I have two channels, Products and Businesses. The Products channel has a relationship field that ties back to the business selling it. The products are returning successfully on my results page with keyword and categories. Unfortunately when I try and narrow the results for this relationship it does not work. The results page is displaying all products and not filtering the result. I know the entry_id from the business is successfully passing through the form once a business is selected too.

The goal of this search filter is to display products related to a business. For example, if you select "Business Name" it will display the 10 products related to it.

I have tried a number of different parameters and I'm stuck. Thanks in advance!

Form Code:

    {exp:low_search:form result_page="shop/search" query="{segment_3}"}
        <input type="search" name="keywords" class="input-search" placeholder="Search Products" />
        <div class="select-dropdown">
            <select name="category[]">
                <option value="">Product Category</option>
                <option value="">--</option>
                {exp:channel:categories category_group="3" style="linear"}
                <option value="{category_id}"{if low_search_category ~ '/\b'.category_id.'\b/'} selected{/if}>{if parent_id != '0'}&nbsp;- {/if}{category_name}</option>
                {/exp:channel:categories}
            </select>
        </div>
        <div class="select-dropdown">
            <select name="child:product_seller[]">
                <option value="">Business Name</option>
                <option value="">--</option>
                {exp:channel:entries channel="neighborhood_business" orderby="title" sort="asc" limit="1000" dynamic="no"}
                <option value="{entry_id}">{title}</option>
                {/exp:channel:entries}
            </select>
        </div>
        <input type="submit" class="btn-submit" value="Search" />
    {/exp:low_search:form}

Results Code:

{exp:low_search:results query="{segment_3}" collection="shop_product" limit="18" paginate="bottom" paginate_base="shop/search/{segment_3}" keywords:inflect="yes"}
{if no_results}
<div class="searchNoResults">
    <p>Sorry, your search returned no results.</p>
</div>
{/if}
{if count == 1}
<div class="productItems">
{/if}

    <div class="item">
        <a href="{title_permalink='shop/product'}" title="Learn more about {product_title}">
            {if '{product_a_gift_card}' == 'Yes' AND '{product_image1}' == ''}
            <img src="{site_url}assets/img/shop/products/gift_card.png" alt="{title}" />
            {if:else}
            <img src="{product_image1:thumb}" alt="{title}" />
            {/if}
        </a>
        <div class="content">
            <p class="price">${product_price}</p>
            <h2><a href="{title_permalink='shop/product'}" title="Learn more about {product_title}">{product_title}</a></h2>
            <p class="business">By: {product_seller}{product_seller:title}{/product_seller}</p>
            <a href="{title_permalink='shop/product'}" class="cta-btn" title="Learn more about {product_title}">Learn More</a>
        </div>
    </div>

{if count == total_results}
</div>
{paginate}
<div class="paginationContainer">
    <p>Page {current_page} of {total_pages}</p>
    <div class="paginationLinks">{pagination_links}</div>
</div>
{/paginate}
{/if}
{/exp:low_search:results}
1
  • Okay, so, the product_seller is present in the Products channel, correct? Can you enable the template debugger and copy/paste all lines that mention Low Search here in your question? That will help to give insight as to what is happening.
    – Low
    Dec 11 '20 at 19:36
1

This was due to global setting being disabled. Filters can be enabled/disabled within the plugin's settings. One checkbox later and it works! Thanks for the fast support Low.

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.