Adding price to search results

Highlighted
New Member
1 0 0

Currently search results on my site only shows the product name and description, I'd like to also show the item price.

Just learning my way around html, so any help or advice would be great.

0 Likes
Highlighted
Shopify Expert
20 3 4

Hey Dane, 

Once you're in your search.liquid file find the loop for search results. Should look like 

{% for item in search.results %}
...
{% endfor %}

Within that for loop something like the following will work. I typically have a bit more code to check if product is on sale, sold out, etc. 

{% if item.object_type == 'product' %}
 {{ item.price | money }}
{% endif %}

Hope that helps.

 

 

https://enjoythemecompany.com/
0 Likes
Highlighted
Tourist
5 0 1

Hi Simon_Jones!

Where exactly do I put this code within that loop? I can't seem to make it work. Thanks!

0 Likes