add a product if a search leads nowhere

Hello,

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.

Hello,

To be able to do that you will need to add a blog post through your Shopify store. Then you can now connect it to your store

Hi @Audric

If you’re comfortable with code or have a developer:

  1. Go to Online Store > Themes > Edit Code.
  2. Open the file search.liquid (or search.json, depending on your theme).
  3. 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 %}​

Hi @Audric

Please install Search & Discovery app so you can set Recommendations product when searching