I’d like to make it so that if someone searches for something and the search comes up empty, a particular product is displayed. I sell posters of music albums. I have an item that is a custom poster. I’d like to make sure that if someone searches for an artist/album and no results are found, that the custom album item is displayed. I hope you can help me.
If you’re comfortable with code or have a developer:
Go to Online Store > Themes > Edit Code.
Open the file search.liquid (or search.json, depending on your theme).
Add logic to check if search results are empty, then display your custom product:
{% if search.results_count == 0 %}
No results found. Check out our Custom Album Poster!
{% include 'product-card', product: all_products['custom-poster'] %}
{% endif %}