When i search for a product by sku code, I get a ‘no results found’ response as I type it in. However, when I press return key, the search engine displays the product in the results field.
So, is there any way of editing the code to either:
a) remove the ‘no results found’ wording
b) add some additional code to find the variant sku as i type.
This behavior happens because Shopify’s predictive search (the live search suggestions you see as you type) only indexes product titles, descriptions, and a few other fields — but it does not include variant SKUs. That’s why you see “no results found” while typing the SKU, but the product shows up after pressing enter (full search).
You have two options:
a) Remove the “no results found” message
You can edit your predictive search snippet (usually predictive-search.liquid or similar in your theme) and either hide the message with CSS or adjust the Liquid so that the “no results found” text doesn’t render. Example with CSS:
.predictive-search__no-results {
display: none;
}
b) Enable searching by variant SKU in live search
This is more complex because Shopify’s predictive search API doesn’t natively support variant SKUs. To achieve this, you’d need:
A third-party search app (like Searchanise, Algolia, or Boost AI Search), OR
A customization where you index SKUs in product tags or metafields, then expose those to predictive search. For example, add each SKU as a tag to the product, then predictive search can pick it up.