2.0 Beta

Smootify 2.0 is in public beta. Your 1.x store keeps working. Move when you want.

What changed

Predictive search

A search field that shows products and search suggestions as the visitor types, in a Webflow Dropdown, a popover or right on the page. Covers smootify-search, its regions, the result template and the link to the search page.

v2.0 betaAdd-on: Predictive Search
Open .md1.x page ↗
On this page
  1. How it fits together
  2. 1. Add the search field
  3. 2. Choose where the results appear
  4. 3. The regions
  5. 4. The results
  6. 5. Suggestions, the typed words and the search page
  7. While it loads
  8. Before you publish
  9. Coming from 1.x

Predictive search shows results while the visitor types: up to 10 products, and the searches Shopify suggests for those words. It usually sits in the navbar, with the results in a Webflow Dropdown or a popover. For the full list of results, pair it with a search results page.

Note

Turn on the Predictive Search add-on in the Smootify dashboard. The Lite and Server plans include it. On your .webflow.io address it works without it, so you can build and test first. Shopify’s Search & Discovery app can tune the results, for example with synonyms, but it is not required.

How it fits together

What Smootify needs:

  • a smootify-search element;
  • inside it, a Text field whose Name setting is query. It sits in a Form Block, as every Webflow field does.

What is up to you:

  • where the results appear: in a Webflow Dropdown, in a popover, or in place on the page, such as in a menu panel;
  • which parts you use: the result list, the suggestions, the empty message, the content shown before the visitor types;
  • how a result looks: a simple result template, or a full product card.
Example structure of the Navigator
smootify-searchCustom Element
Form Block
Form
Text FieldName “query”
Dropdown
Dropdown Toggle
Text Block“Results”
Dropdown List
search-with-queryCustom Element
search-resultCustom Element
Link Blocksearch=url
Imagesearch=image
Text Block“Product name”search=title
Text Block“$0.00”search=price
search-emptyCustom Element
Text Block“No products found”

1. Add the search field

  1. Add a Custom element with the tag smootify-search.
  2. Inside it, add a Form Block with one Text field. Smootify searches with it whatever its Name. With two text fields, set the Name of the search one to query.

Smootify searches a short moment after the visitor stops typing, and when they press Enter. The Form Button is optional.

limit on smootify-search sets how many products show, up to 10, which is also the default. Shopify returns at most 10 products for a predictive search.

2. Choose where the results appear

The results can appear in one of three places:

A Webflow Dropdown

Put the results
Inside the Dropdown list.
Opens
As the visitor types.
The field
Inside the Dropdown or next to it.

A popover

Put the results
Inside a popover.
Opens
When the visitor clicks the field, so the suggestions for an empty field show, and as they type.
Closes
With a button that has data-action="close", anywhere in smootify-search, such as next to the field. See Popovers.

In place

Put the results
Anywhere in smootify-search, with no Dropdown or popover.
Shows
Each part shows and hides itself where it is, such as in a full-screen menu.

3. The regions

These Custom elements show and hide themselves with the state of the search. All are optional:

search-no-query

Shown while the field is empty.

Your own suggestions, such as popular searches.

search-with-query

Shown while the field has words in it.

The results, the empty message, Shopify's suggestions.

search-empty

Shown while the words found no product.

A message such as "No products found".

search-suggestions

Shown while Shopify has search suggestions for the words.

Shopify's suggestions. Put it inside search-with-query.

In a Webflow Dropdown without search-with-query, the Dropdown list stays hidden until there are results or the empty message.

4. The results

There are two ways to show a result:

search-result

A result template

Built with
A Custom element with search="…" values inside, copied once per product.
Prices
search="price" and search="compare-at-price". A smootify-price here has no product to read.
smootify-productdata-id="search"

A product card

Shows
Everything a product card shows, such as smootify-price or an add-to-cart button.
Loads
The whole product from Shopify, for each card.

A result template. Add a Custom element with the tag search-result. It is the template: Smootify copies it once per product, and removes other search-result elements you designed. Inside it, search="…" fills an element with a value of the product:

  • search="title", search="vendor", search="type": text;
  • search="url" on a Link block or a Text link: the product page’s link;
  • search="image" on an Image: the product’s main image;
  • search="price": the lowest price of the product;
  • search="compare-at-price": its crossed-out price, removed when it is not on sale;
  • search="collection": the first collection’s name, with its link on a Text link.

image, compare-at-price and collection are removed when the product has none. A result that cannot be bought gets the class is-not-available. Every value is in predictive search attributes.

A product card. Instead of search-result, put a smootify-product with data-id="search" inside search-with-query, and design it as a product card. The first card is the template.

Example structure of the Navigator
search-with-queryCustom Element
smootify-productCustom Elementdata-id=search
Text Link“Product name”product=url
smootify-priceCustom Element
Text Block“$0.00”data-prop=price

5. Suggestions, the typed words and the search page

Example structure of the Navigator
search-no-queryCustom Element
Text Block“Popular searches”
Text Link“Sneakers”search=suggested-query
search-with-queryCustom Element
Div Block
Text“Results for”
Text Span“shoes”search=query
search-suggestionsCustom Element
Text Link“Suggestion”search=suggested-query
Text Link“See all results”search=search-page
  • Shopify’s suggestions. Inside search-suggestions, a Text link with search="suggested-query" is the template of one suggestion. A click searches it. Put search-suggestions inside search-with-query: suggestions only exist once the visitor has typed.
  • Your own suggestions. In search-no-query, Text links with search="suggested-query" are fixed suggestions, such as popular searches. A click searches their text. Keep them outside search-suggestions.
  • The typed words. search="query" on text shows what the visitor typed, for example in “Results for shoes”.
  • The search page. A link with search="search-page", set in Webflow to your search page, gets the typed words added to its address, so the search page opens with the same search. A Webflow Button works here too, since it is a link.

While it loads

While a search runs, smootify-search has the class is-loading. Nothing shimmers by default: style that class, or add skeleton to the elements in the result template. Smootify also sets has-query, has-products, is-empty and has-suggestions on smootify-search. See state classes.

Before you publish

Check these first

  • Nothing happens when typing. smootify-search has two text fields, and neither has the Name query.
  • Never more than 10 results. That is Shopify’s limit for predictive search. Add a link with search="search-page" to show all results.
  • Prices are empty in the results. A smootify-price inside search-result has no product to read. Use search="price", or product cards.
  • Attributes on the second result do nothing. Only the first search-result is the template.
  • Suggestions never show. search-suggestions is inside search-no-query, which hides as soon as the visitor types. Move it into search-with-query.
  • It works on .webflow.io but not on the live domain. The Predictive Search add-on is not turned on for the site.

Coming from 1.x

  • The results no longer shimmer while loading, and Smootify no longer adds a hidden placeholder result: style is-loading or add skeleton.
  • Inside search-result, use search="price" and search="compare-at-price" instead of smootify-price.
  • limit above 10 is capped at 10.

    ↑ ↓ to moveEnter to openEsc to close