Hello there
Yes, it is possible to make the products show up in the search bar for metafield values in Shopify. However, it requires some customization to your Shopify theme.
To make the products show up in the search bar for metafield values, you can follow these steps:
-
Create a new search input field in your Shopify theme. This can be done by modifying the theme’s header or search template file.
-
Use Liquid code to query the product metafields and search for any matches based on the search input.
{% for product in collections.all.products %}
{% assign metafields = product.metafields %}
{% for metafield in metafields %}
{% if metafield.value contains search %}
{{ product.title }}
{% endif %}
{% endfor %}
{% endfor %}
-
Customize the code as needed to match your theme and search requirements. You can modify the search input field styling, search algorithm, and display format for the search results.
-
Save the changes to your Shopify theme and preview the search functionality to ensure that it is working correctly.