I want to customize the search results display in Shopify Search & Discovery

I’ve assigned a special template to discontinued products and kept them on the site, hiding the price.
However, the price is still displayed in the search results of Shopify Search & Discovery.
Since I’ve included the words “Discontinued” in the product name, is there a way to use this to hide the price?

You can check this. Maybe it’s helpful for you.

  1. Add tag: discontinued

  2. Modify theme:

</> Liquid
{% unless product.tags contains ‘discontinued’ %}
{{ product.price | money }}
{% endunless %}
(Optional)
Replace price with:
“Discontinued / No longer available.”

  1. (Optional)
    Replace price with:
    “Discontinued / No longer available.”

Hi @mpex ,
Yes, but Shopify Search & Discovery doesn’t support hiding prices based on product titles directly. However, you can handle this with a small Liquid condition in your product card snippet.

Since your discontinued products include “Discontinued” in the title, wrap the price output like this in the search product-card file (usually card-product.liquid or similar):

{% unless product.title contains 'Discontinued' %}
{{ product.price | money }}
{% endunless %}

Dear mastroke and oscprofessional,

Thank you for your advice.
I’m using the Dawn 15.4.0 theme, and I was able to resolve the issue by enclosing {% render ‘price’ … %} in card-product.liquid with unless as shown below.

{% unless card_product.title contains ‘Discontinued’ %}
{% render ‘price’, product: card_product, price_class: ‘’, show_compare_at_price: true %}
{% endunless %}

@mpex use the unlisted status to keep the entire product out of search