Skip to main content

Add Hyper Search to your site

Add two Hyper Search containers to your BigCommerce Stencil theme, then enable the storefront integration in the app.

Before you begin

Download a copy of your current theme and make these changes in a duplicate. Test the duplicate before applying it to your live storefront.

Add the search box to the header

Add this element where the search input should appear:

<div class="s48_hypersearch"></div>

In Cornerstone, replace the contents of templates/components/common/quick-search.html with:

<div class="container">
<div class="s48_hypersearch"></div>
</div>

The legacy-looking s48_hypersearch class is still required by the current storefront application.

Replace the search results

Add the results element where the full results page should appear:

<div id="s48_hypersearch-results"></div>

In Cornerstone, replace templates/pages/search.html with:

---
product_results:
limit: {{theme_settings.searchpage_products_per_page}}
---
{{inject 'categoryTree' forms.search.category_options}}
{{inject 'searchProductsPerPage' theme_settings.searchpage_products_per_page}}
{{inject 'searchResultsCount' (lang 'search.results.count' count=result_count search_query=(sanitize forms.search.query))}}

{{#partial "head"}}
{{#if pagination.product_results.previous}}
<link rel="prev" href="{{pagination.product_results.previous}}">
{{/if}}
{{#if pagination.product_results.next}}
<link rel="next" href="{{pagination.product_results.next}}">
{{/if}}
{{/partial}}

{{#partial "page"}}
{{{stylesheet '/assets/scss/vendor/jstree/style.css'}}}
{{> components/common/breadcrumbs breadcrumbs=breadcrumbs}}
<section class="page">
<div id="s48_hypersearch-results"></div>
{{{region name="search_below_content"}}}
</section>
{{/partial}}

{{> layout/base}}

The s48_hypersearch-results ID is also required by the current storefront application.

  1. Upload and apply your edited theme.
  2. Open Settings > Storefront in Hyper Search.
  3. Enable the storefront integration and save.
  4. Test the header input, autocomplete or overlay, and the full search results page.

Storefront integration enabled in Hyper Search settings

Customise the product grid template

To match the search product cards to your theme, open Settings > Storefront > Developer.

Developer tab containing the Hyper Search product card template

Product card templates use JSX. Output a field with braces, for example {product.name}.

Available product fields

FieldDescription
product.brandBrand name.
product.categoriesArray of category names.
product.channel_idsArray of assigned BigCommerce channel IDs.
product.descriptionProduct description as HTML.
product.display_priceFormatted product price with currency.
product.hover_image_urlDeprecated; use product.images instead.
product.image_urlVariant image when available, otherwise the product thumbnail.
product.imagesAll product images, including thumbnail, standard, tiny and zoom URLs.
product.in_stockProduct availability message.
product.meta_descriptionProduct meta description.
product.meta_keywordsProduct meta keywords.
product.nameProduct name.
product.on_saleWhether the product is on sale.
product.page_titleProduct page title.
product.priceBase product price as a number.
product.product_idBigCommerce product ID.
product.product_variant_idID of the represented product variant.
product.review_rating_sumSum of review ratings.
product.sale_display_priceFormatted sale price when set.
product.sale_priceSale price as a number when set.
product.search_keywordsSearch keywords assigned to the product.
product.skuProduct or variant SKU.
product.stock_qtyAvailable inventory.
product.updated_atDate and time of the most recent product update.
product.urlStorefront-relative product URL.

You can make additional fields available by adding them as an indexed field.

Available product functions

FunctionResult
product.getPrice()Numeric price in the active currency.
product.getDisplayPrice()Formatted price in the active currency.
product.getSalePrice()Numeric sale price in the active currency, when set.
product.getSaleDisplayPrice()Formatted sale price in the active currency, when set.
product.getMsrpPrice()Numeric MSRP in the active currency.
product.getMsrpDisplayPrice()Formatted MSRP in the active currency.
product.getOnSale()Whether the product is on sale.
product.hasVariants()Whether the product has variant options.
product.renderImage(options)A responsive product image element.

For other storefront settings, see Customise the design.

Build a custom integration

If the built-in integration does not meet your requirements, you can implement a custom storefront experience. Hyper Search is powered by Typesense; review the Typesense guidance on building search interfaces to understand the available approaches.

Contact support for the connection details for your store. Do not expose those details in public source code.