↑↓ selectEnter openEsc closeAll results

  1. Elbuz
  2. Elbuz User Guide
  3. Website and widgets
  4. Smart search

How to add smart search to your site

4 min readUpdated

Elbuz smart search replaces the search bar on OpenCart, WooCommerce, WordPress, Shopify or any other CMS: enter the site address and field selector, then paste the code.

When you need this:

  • Any CMS — one script, whatever the engine.
  • A popular CMS — picking it fills in selectors, cart button code and page addresses.
  • On phones search hides behind a magnifier — a mobile button selector opens it.
  • The first click shows “Loading...” — “Fast search opening” loads the widget with the page.

Where to start: fill in the address and selector on the “Setup” tab and paste the code.

What you set up in the widget form

The smart search form has six tabs, each made of white cards with a hint under the heading. The form saves itself on every field change; there's no “Save” button.

TabWhat's on itWhere it's described
Settingsfeature toggles, site and selectors, synonyms, search index, integration code, APIhere; synonyms, index, API
Informationsummary of store data from the company details, placeholder and words in the search bar, widget namehere
Viewwindow, colors, results, buttons, blocks, fields, embedding, your own CSS and JSsearch window look
Products and pricesavailability, product selection conditionwhich products to show
Products and pricesprice field, RRP, sale and old price, currencyprices and currency
Links and eventsstore pages, link templates for the product, category, photolinks and language prefixes
Links and eventsJS code for the cart, wishlist and compare buttons, product ID from the pagecart, wishlist, and compare
Search testthe same results as on the site, without the widget installedresults test

How to add the widget to your site

Setup is the “Site and search box” card plus one pasted code snippet. An Elbuz CMS store needs nothing pasted: search turns on by itself when the store is created (what turns on automatically).

  1. Turn on “Activity” in the “Search features” card. Without it, search doesn't work on the site and the integration code contains no search.
  2. Site address — the site where the widget will run, for example https://myshop.com. A trailing slash is removed automatically.
  3. CMS ID and, for OpenCart, CMS theme — if your CMS is in the list, the app fills in the remaining fields, see below.
  4. CSS selector to replace the search field — the spot on the page where the widget goes. The default is #search; for your theme it may be the search bar class. The CSS selector for the search button on the mobile version is set separately: on phones the bar is often hidden behind a magnifier icon.
  5. Integration code — copy it with the copy button in the “Integration code” card and paste it into your site's <head>. The code is built when the form opens: if you've just turned on “Activity”, close and reopen the form before copying. It's a small script that loads the current widget version by itself, so later setting changes don't require new code.
  6. Build the search index — without it, search has nothing to search.

To see the widget before pasting the code on your live site, use “Open demo site”; to check the results themselves, use the “Search test” tab.

The “Setup” tab of the “Smart search” widget: feature toggles and the fields for connecting to the site
1Search on the site
2Fast opening
3Site address
4CMS and theme
5Site search field
6Search button on phones
  1. Without “Activity” search doesn't work on the site, and the integration code has no search.
  2. The widget loads with the page, without waiting for signs of a live visitor.
  3. The site the widget will work on.
  4. Choosing a CMS fills in the selectors, the cart button code and the page addresses by itself.
  5. The spot on the page the widget will replace.
  6. The magnifier that hides the search box on phones.

If the Elbuz AI chat also runs on your site, the same integration code loads both widgets. After turning either of them on or off, reopen the form and copy the code again.

What choosing a CMS fills in

The “CMS ID” list has WooCommerce (WordPress), Shopify, Magento (Adobe Commerce), OpenCart, Elbuz CMS, PrestaShop, BigCommerce, Squarespace Commerce, Horoshop. For OpenCart, “CMS theme” offers OCT ShowCase, OCT Deals and OCT Promo; the theme list shows only themes of the selected CMS. As soon as you pick a CMS or theme, the app applies its ready-made settings:

  • both CSS selectors — for the search field and the mobile button (the mobile one for OpenCart themes);
  • button code on the “Links and events” tab — which CMSs have it, see cart, wishlist, compare;
  • “CSS Styles” and JS code on the “View” tab, if the theme or CMS needs them;
  • for Horoshop — “Product ID extraction”;
  • links to the cart, checkout, deals, compare and wishlist — if the “Site address” is already filled in.

Empty fields are filled in right away. If the preset would change a field you've already filled in, the app lists those fields and asks:

  • Replace — all fields come from the preset, your values in the listed fields are replaced;
  • Fill empty only — your values stay, the preset goes only into empty fields;
  • Cancel — nothing changes, the lists return to the previous CMS and theme.
The “Apply CMS settings?” dialog with the list of filled-in fields and the “Replace”, “Fill empty only” and “Cancel” buttons
1Question
2Fields that will change
3Replace
4Empty only
5Cancel
  1. The app asks only when the preset would change fields you have already filled in.
  2. The preset will replace your values in these fields.
  3. Everything from the CMS preset.
  4. Your values stay; the preset goes only into empty fields.
  5. Nothing changes; the previous CMS and theme come back.

A field the preset has no value for stays as it is. Your CMS isn't in the list — leave “---” and fill in the selectors and button code yourself: choosing “---” changes nothing.

What the “Search features” toggles turn on

ToggleDefaultWhat it does
Activity—turns on search on the site. Turning it off deletes the search index — see what disappears
Voice searchona microphone button in the search bar: the shopper dictates the query, the browser recognizes speech
Search by attributesonsearches by specifications and shows filters for them; takes effect after an index update
Show AI chatonthe AI assistant in the search window — how it works
Fast search openingoffthe widget loads together with the page — see below

Fast search opening

By default the widget doesn't start right away but after signs of a live visitor: mouse movement, a touch, scrolling. Bots that just load pages show no such signs, so the search service isn't spent on them. The trade-off: the first click in the search field sometimes shows “Loading...” while the widget finishes loading.

The “Fast search opening” toggle removes this delay: the widget loads together with the page, and what the shopper does before loading finishes — a click in the field, the first letters — isn't lost and runs as soon as the widget is ready.

The downside is weaker bot protection: the widget still recognizes known bots by browser name and doesn't start, but a bot posing as a regular browser will call the service, and there will be more requests.

  • Once saved, the server starts filtering out bots by browser name right away. Fast start itself turns on for each visitor from their next page view: the first time, the widget learns the setting and starts as usual. After you turn the toggle off, one more page view also runs in fast mode.
  • After turning it on, check on an iPhone that the keyboard opens on the first tap in the search field.

What shoppers see in the empty search bar

The “Information” tab, the “Search box on the site” card.

  • Search field placeholder — the gray text in the empty field. Left empty, a default placeholder appears in the visitor's language; your own text is shown the same in all languages.
  • List of words to simulate typing in the search bar (separated by commas) — sample words that type themselves into the field as if a person were typing. There's a separate field for each enabled site language: shoppers see words in their language, and if the field for their language is empty, the main language words.

On the same tab:

  • Widget information — “Name” and “Description” are only for you in the widget list; shoppers don't see them.
  • The “Store details come from the company card” banner shows which store data is filled in and which isn't: the widget takes the logo (shown in the search window header), name, contacts, address, opening hours and store terms from the company details. The “Edit in the company card” button opens them.
The “Information” tab: store details from the company card, the search field placeholder and the words for simulated typing
1Store details
2Placeholder
3Sample words
  1. The widget takes the store logo, name, contacts and terms from the company card.
  2. If empty, the standard hint in the visitor's language.
  3. The words type themselves in the field; each language has its own field.

Scenarios

An OpenCart site with the OCT ShowCase theme

What to do. Enter the “Site address”, choose OpenCart in “CMS ID” and OCT ShowCase in “CMS theme”, then paste the integration code into <head>.

What you get. The field and mobile button selectors, cart code and page links are filled in; search takes the place of the theme's search bar, on phones too.

On phones the search bar is hidden behind a magnifier icon

What to do. Besides the search field selector, fill in the CSS selector for the search button on the mobile version.

What you get. On phones, search opens with this button, and filters are in a slide-out panel. Without this selector, search doesn't open on phones.

The first click in the search field shows “Loading...”

What to do. Turn on “Fast search opening” and check on an iPhone that the keyboard opens on the first tap.

What you get. The widget loads together with the page, and the click and first letters typed before loading finishes aren't lost. The first page view after saving still runs in normal mode.

What to do when the widget doesn't work as expected

What you seeWhyWhat to do
The widget didn't appear on the sitethe integration code isn't pasted, isn't pasted into <head>, or was copied while “Activity” was offturn on “Activity”, reopen the form, copy the code again and paste it into the template
The widget is there but not in place of the search fieldthe CSS selector in the settings is wrongspecify the selector of exactly the element being replaced
The site's search bar is the regular one, without the widget“Activity” is off, or the search index tables don't existturn on “Activity” and build the index
Search doesn't open on phonesthe mobile search button selector isn't setfill in the separate field for the mobile version
Product cards have no “Buy” buttonthe JS code for adding to cart isn't specified, or products have no ID from the CMSfill in the button code

FAQ

How do I see the widget before adding it to my live site?

Use the “Open demo site” button in the “Site and search box” card. The results themselves are checked on the “Search test” tab — see how to set up search results.

Will the code disappear from my site if I turn off smart search?

No. The code in <head> is a line in your site template, and you remove it yourself. More: what disappears if you turn off smart search.

Where do I change the logo and store details used by search?

In the company details: search takes them from there and updates them by itself. The “Edit in the company card” button on the “Information” tab opens them.

Where is the “Save” button?

There isn't one: the form saves itself on every field change and when the window closes, and the site sees the changes after a page reload. Only the condition on the “Products and prices” tab has its own button.

Where to find it and who has access

Menu
Products → Categories → “Widget settings - Smart search” tile
Access right
the “Smart product search widget” window in “Group permissions”
Prepare
access to your site template, to paste the code into <head>

Related topics

Was this article helpful?

Missing a feature? Tell us.

We will add it for free if other users need it too.

If only you need it, we will agree on it separately.

Article contents

Suggest an improvement

Try Elbuz free