I am using the latest version of Dawn theme. It seems like predictive search includes only product titles, collection titles, product types, and vendors. I want it to include tags and product descriptions. How can I do this? Thank you!
Hi, @ftfiy !
To include tags and product descriptions in the predictive search results of your Shopify store using the Dawn theme, you will need to modify the code of your theme. Here are the steps you can follow:
- From your Shopify admin panel, go to Online Store > Themes.
- Click on the Actions button for the Dawn theme, and select Edit code from the drop-down menu.
- In the left-hand menu, click on the Assets folder, and then click on the theme.scss.liquid file to open it.
- Add the following code at the bottom of the file:
.search-results__description {
display: none;
}
.search-results__tag {
display: none;
}
- Next, open the templates/search.liquid file.
- Find the following code block:
{% for result in search.results %}
{% capture product_type %}{{ result.object_type }}{% endcapture %}
{% if product_type == 'product' %}
{% include 'search-result' %}
{% endif %}
{% endfor %}
- Replace it with the following code block:
{% for result in search.results %}
{% capture product_type %}{{ result.object_type }}{% endcapture %}
{% if product_type == 'product' %}
{% include 'search-result' with result, show_description: true, show_tag: true %}
{% endif %}
{% endfor %}
- Save the changes to the file.
With these changes, your predictive search results will now include tags and product descriptions. If you want to customize the display of the search results, you can modify the search-result.liquid file in the Snippets folder of your theme.
Note: It is always recommended to create a backup of your theme before making any changes to the code. Also, modifying the code of your theme can be a complex task, and it is recommended that you have some experience with HTML, CSS, and Liquid programming languages.
Let me know if this helps!
Hi Ignelis! Thanks for your response. Unfortunately, my Dawn theme does not have a theme.scss.liquid file or a search.liquid file. I am using the latest version. Can you tell me what the updated file names are? I appreciate your help!
Hi
There is no code as per your suggestion. What is updated code is in main-search?liquid file?
@ftfiy you want something like this in predictive search you can add
{{product.description}}
below of the {{product.title}} in predictive-search.liquid file
@Ujjaval thanks for your reply, but this is not what I am looking for. Let me try to explain better… Predictive search seems to be configured to search product titles, product types, vendors, and collection titles only. I need predictive search to also read tags and product descriptions so that it matches the search results. What is happening now is that if someone searches a keyword, lets say “pink”, the predictive search will only suggest products that have pink in the title. But the search results returns all products with pink in the title, descriptions, and tags. Any suggestions? Thank you!
I’m also looking for this feature
Me too ![]()
If Someone have a solution, please Reply me or contact me on email ![]()
