All things Shopify and commerce
I have searched the similar question in the community. The answer is to edit the store theme code. I have tried to follow the instruction, but I have no experience in code editing.
I am using the theme 'Dawn'. Does anyone know where to edit the code? I am following the link on this page: https://shopify.dev/themes/navigation-search/search but still have no idea where to add the code.
Solved! Go to the solution
This is an accepted solution.
Hello @KATZZ
I would like to give you some recommendations to support you
You can follow these steps:
1. Go to Online Store->Theme->Edit code
2. Open your header.liquid theme file
Please search with keywords: 'search__button '
add the code just above the button
<input type="hidden" name="type" value="product" />
Hope my recommendation can works and support for you! Kind & Best regards! GemPages
Hello @KATZZ
1) Open your admin panel.
2) Click on online store.
3) Then click on action button in the dropdown click on Edit code.
This is an accepted solution.
Hello @KATZZ
I would like to give you some recommendations to support you
You can follow these steps:
1. Go to Online Store->Theme->Edit code
2. Open your header.liquid theme file
Please search with keywords: 'search__button '
add the code just above the button
<input type="hidden" name="type" value="product" />
Hope my recommendation can works and support for you! Kind & Best regards! GemPages
Thanks! It is very clear. I have successfully edited it.
Hello @KATZZ,
This is flareAI: your Fully Automated Free Sales Machine. I hope you're having a good day. flareAI is helping lots of successful Shopify stores generate $5+ million in sales from Google Search, on autopilot.
If my suggestions is helpful to you, please let me know by giving a like or marking it as a solution.
You can restrict the Shopify search to show only product pages.
To achieve a custom search, you can add a hidden field in the header.liquid file.
Go to your Online Store > Themes > Edit code > header.liquid file
Find 'routes.search_url' and add the hidden field inside the <form action={{routes.search_url}}> section.
<form action={{routes.search_url}} ....>
<div class="field">
<input type="hidden" name="type" value="product">
......
</form>
Similarly, go to main-search.liquid file, find 'routes.search_url' and add a hidden field there also:
<form action={{routes.search_url}} ....>
<div class="field">
<input type="hidden" name="type" value="product">
......
</form>
This will restrict giving only product pages in the storefront search result.
You can read this blog for more details.
Hope this helps,
Gina
flareAI
what should the value be if i want to include products and pages but exclude only blog articles?
i think i figured it out. to include product and pages (but not blog articles):
<form action={{routes.search_url}} ....>
<div class="field">
<input type="hidden" name="type" value="product,page">
......
</form>
Question - what line did you replace or add that code you posted in? Still having trouble removing only blog/press posts from my site. Thanks for your help, it would be much appreciated!
I hope this helps, dawn theme, install "Search & Discovery" - it's completely free, from search and discovery app go to Settings and uncheck "Blog" in what to include in the in-search. like so:
Thanks for the assistance! Any idea if that works with the 'Impact' theme?
As i've untoggled that box but press/"blog posts" are still showing in search engine.
No idea, but I think it should maybe wait for 5 minutes?
User | RANK |
---|---|
40 | |
37 | |
24 | |
22 | |
15 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023