Hi all, I am new to the Shopify, when someone searches my store for "salt lamps" only then my manually added "page" should kick in with the url /pages/salt-lamps and show search results for "salt lamps" on my manually created regular page. Is this possible? if yes then please guide me through how can I add this functionality to my online store without using any apps.
The code below creates a search box. You probably wanna add it in page.liquid. For very specific custom coding you'll have to hire a developer to assist you.
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find page.liquid file and add this code:
<form method="get" action="/search"> <input type="text" name="q" /> <input type="submit" value="Search" /> </form>
Let me know whether it works.
Thanks @diego_ezfy for your reply, I added this but this adds search form to the regular page. following is what I am looking for my store.
1- User searches for any string in any search form
2- checks if string is "salt lamps", if yes then redirect to /pages/salt-lamps and show result on that page, if string is not "salt lamps" then apply regular search.
By SEO perspective i am thinking.
Once again thanks a lot for your prompt reply, looking forward for a solution to this.
Oh, I see.
In case you're unfamiliar with these technologies you may want to hire a Shopify developer to assist you.
ok so now I have added custom jQuery code, that changes the form's action to /pages/salt-lamps in case of "salt lamps" and submits via jQuery. In my regular salt-lamps page i have a custom suffix page.custom-search.liquid
for the page.custom-search i have included a snippet custom-search and copied code from search.liquid but as 'snippet' doesnot implement the search, it shows Array 'search.results' is not paginateable.