Support

Product Search On Jumpseller

How does search work

All Jumpseller Stores regardless of the plan come with simple search capabilities. Search can be an important aspect of improving the customer experience on your website and help them find the things they are looking for.


How to add a Search Form

You can add a search form on any page of your Online Store by including the piece of code you see below on your Theme Editor.

<form method="post" action="{{search.url_send}}">
  <input type="text" name="q" value="{{search.query}}" />
  <input type="submit" value='Search' />
</form>

Most times you will want to add it at the Layout Block.

Search is done on the following Product Fields:

  • Name
  • Description
  • SKU
  • Custom Fields
    • Inputs
    • Text Areas
    • Select Options
  • Variants
    • SKU

Configure these fields to be used for search by defining the fields at the query string:

/search/shoes?fields=name,sku

Or you can define these fields to be searched with an hidden input field in your Search From:


<form method="get" action="{{ search.url_send }}">
  <input type="text" name="q" value="{{ search.query }}" />
  <input type="hidden" name="fields" value="name,sku" />
  <input type="submit" value='{% t "Search" %}' />
</form>

If you do not use this input all the fields of your products will be considered on the search:

  • name,
  • sku,
  • description,
  • custom_fields
  • variants

All the search terms will use the OR operator.

Searching for: winter shoes will search products with both "winter" and "shoes" terms in their Fields.

We execute broad searches for every search terms, considering wildcards for the beginning and end of each term.

Searching for: win shoes will return products with either "winter" or "winner" terms on their Fields, like: Product named "Leather Winter Shoe" or "Nike Winner Shoes".


How to filter out results from categories

It is possible to filter out the products from specific categories from the the search results. You'll need to add some Liquid logic at the Search Results block.

At the Search Results Block you find something like:

{% paginate search.results by 8 %}
<article>
<h1 class="title-product">{{product.name}}</h1>
<h2 class="description-product">{{product.description}}</h2>
</article>
{% endfor %}

before paginating the results with {% paginate search.results by 8 %} add:

{% assign filtered_cats = "category-permalink-1|cat-perm-2|cat-perm-3" | split: "|" %}

to select the categories to filter out from the search results. And after the Product loop:

{% for product in paged.results %} add the Liquid logic:

{% assign filter_out = false %}
{% for category in product.categories %}
{% if filtered_cats contains category.id %}
{% assign filter_out = true %}
{% endif %}
{% endfor %}

which changes the value of filter_out to true when a Product belongs to the Categories at filtered_cats which you want to filter out. Finally before the <article> line you should add an unless:

{% unless filter_out %} and properly close it with {% endunless %}.

The final result is something similar to:

{% assign filtered_cats = "category-permalink-1|cat-perm-2|cat-perm-3" | split: "|" %}
{% paginate search.results by 8 %}
{% for product in paged.results %}
{% assign filter_out = false %}
{% for category in product.categories %}
{% if filtered_cats contains category.id %}
{% assign filter_out = true %}
{% endif %}
{% endfor %}
{% unless filter_out %}
<article>
<h1 class="title-product">{{product.name}}</h1>
<h2 class="description-product">{{product.description}}</h2>
</article>
{% endunless %}
{% endfor %}
{% endpaginate %}

Optionally, to keep track of the number of products that you filter out, you can initialize a counter:

{% assign filter_out_counter = 0 %}

and increase it's value:

{% if filtered_cats contains category.id %}
{% assign filter_out = true %}
{% assign filter_out_counter = filter_out_counter | plus:'1' %}
{% endif %}

you can then use this counter to provide the correct search results number:

{{search.results.size | minus:filter_out_counter}} {% t "Item(s)" %}

FAQ

Is the search case-sensitive?

No. Searching for "Shoes" or "shoes" returns the same results.