Why isn't the search function working in my online store?

Why isn't the search function working in my online store?

LukeBTDC
New Member
4 0 0

I have recently started managing a shopify site and it is currently not possible to search for products.

 

Do we need to add a 3rd party solution to the site to enable this functionality or is it possible to link products to the search function within the online store? 

 

Thank you

Replies 8 (8)

Zeel-prajapatii
Shopify Partner
138 32 27

Hey @LukeBTDC Could you please give your website URL? It will make it much easier for me to address your problem.

 
➔ Was I helpful , please don't forget to like and mark solution as an accepted solution , you can PM me.
➔ Software engineer : Having more than 3 years of experience in the related industry with the specialization of Shopify theme development , worked on hundreds of stores.
➔ Want to hire me? Email me
LukeBTDC
New Member
4 0 0

Hi Zeel, of course! https://thedoorcompanyuk.co.uk/

 

Thank you

Zeel-prajapatii
Shopify Partner
138 32 27

Hey @LukeBTDC It seems "products are not included" in the search functionality. if you search for articles and pages then it will surely provide you the search result. I can fix this can you please share me the code for search bar , the file will be starting with "search" keyword.

 

Thanks

➔ Was I helpful , please don't forget to like and mark solution as an accepted solution , you can PM me.
➔ Software engineer : Having more than 3 years of experience in the related industry with the specialization of Shopify theme development , worked on hundreds of stores.
➔ Want to hire me? Email me
stefansweb2020
Shopify Partner
134 10 5

Yep code problem

banned
LukeBTDC
New Member
4 0 0

Hi Zeel, is this the correct code? I copied from search.json

 

{
"wrapper": "div.collection-wrapper",
"sections": {
"search_header": {
"type": "template--search-header",
"settings": {
}
},
"main": {
"type": "template--search",
"blocks": {
"grid-card-title": {
"type": "grid-card-title",
"settings": {
}
},
"grid-card-price": {
"type": "grid-card-price",
"settings": {
}
},
"grid-card-swatches": {
"type": "grid-card-swatches",
"settings": {
}
}
},
"block_order": [
"grid-card-title",
"grid-card-price",
"grid-card-swatches"
],
"settings": {
}
}
},
"order": [
"search_header",
"main"
]
}

Zeel-prajapatii
Shopify Partner
138 32 27

Hey @LukeBTDC It will be ".liquid" file not a ".json". 

 

Thanks.

➔ Was I helpful , please don't forget to like and mark solution as an accepted solution , you can PM me.
➔ Software engineer : Having more than 3 years of experience in the related industry with the specialization of Shopify theme development , worked on hundreds of stores.
➔ Want to hire me? Email me
LukeBTDC
New Member
4 0 0

Hi Zeel, i copied this from search.scapp.products.liquid

{% layout none %}
{% capture results %}

{% paginate search.results by 6 %}
{% for item in search.results %}
{% assign product = item %}
{
"product" : {{ product | json }},
"id":{{ product.id | json }},
"price":{%if product.compare_at_price %} {{product.compare_at_price | json }} {% else %} {{product.price | json }} {% endif %} ,
"title":{{ product.title | json }},
"product_type":{{ product.product_type | json }},
"vendor":{{ product.vendor | json }},
"handle":{{ product.handle | json }},
"variants":{{ product.variants | json }},
"url":{{ product.url | within: product.collections.last | json }},
"thumbnail":{{ product.featured_image.src | product_img_url: 'thumb' | json }}
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
{% endpaginate %}

{% endcapture %}
searchCallback({
"results_count":{{ search.results_count }},
"results":[{{ results }}]
});

webwondersco
Shopify Partner
1164 169 169

@LukeBTDC Hope you are doing well.

 

The query for the search is wrong. when we add the text in the search bar and enter for search it looks like the products in pages. that's why the products are not showing in search.

 

Your search query will be look like this: https://thedoorcompanyuk.co.uk/search?q=door

 

Web Wonders | Shopify Partner | Connect here!
- Question answered? Mark as Accepted Solution, reply helpful? Click Like
- Hire me, if you want to design, re-design, develop a store, or make changes to the pre-built store.
- a small Coffee Tip would be greatly appreciated. :)..! Instagram