Adding a search feature for the 1st time.

General ShopSite user discussion

Adding a search feature for the 1st time.

Postby pcook » Mon Dec 22, 2014 8:53 am

I've been trying to add the ShopSite search feature to our website for the first time. I've been jumping through the hoops: built a custom template for search results, found a guide to allowing the search to return page results as well as product results, adjusted all the page and product settings, so on and so forth, and when I finally went to add the search bar using the suggested code from the ShopSite templates (http://www.shopsite.com/templates/cookbook/page12-search.shtml):

Code: Select all
<form action="[-- SHOPPING_CART_URL BASE --]/productsearch.cgi?storeid=[-- STORE.ID --]" method="post">
<input type="hidden" name="storeid" value="[-- STORE.ID --]">
<input type="text" name="search_field" size="13" value="[-- STORE.Search --]" onfocus="value=''">
<input type="submit" value="[-- STORE.Go --]">
</form>


I place it in a page, hit publish, and then when I go to it on the site it looks odd. (The search field contains the argument [-- STORE.Search --] and the button contains [--STORE.Go --]). Then when I type in anything and hit said button, I just get "The requested URL /[-- SHOPPING_CART_URL BASE --]/productsearch.cgi was not found on this server." It doesn't matter on what page or where on a page I put the search function.

I'm somewhat new to ShopSite and just plain green at implementing any search, let alone the ShopSite search. How do I get this to actually function? Is there something I'm missing? The apparent lack of "productsearch.cgi" gives me the feeling that I'm missing something elementary to getting this to go. Any help would be greatly appreciated.
pcook
 
Posts: 3
Joined: Mon Dec 22, 2014 7:00 am

Re: Adding a search feature for the 1st time.

Postby Jim » Mon Dec 22, 2014 10:53 am

Where exactly did you put the search code? It must be placed in a custom template file not a normal html file.

If you put it in an "include" template file you must specify the PROCESS option like this
[-- INCLUDE yourfile_name PROCESS --] That will tell ShopSite to evaluate template tags in the file, otherwise they will just be output as text.

You also can not include that code in an field in the back office, such as Page text 1, Header/Footer etc since those fields are not evaluated for template tags.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Adding a search feature for the 1st time.

Postby pcook » Mon Dec 22, 2014 12:38 pm

Oh, thank you! :D For some reason I was under the impression that it could be added anywhere, so I was attempting to add it to a page rather than a template. Now it appears proper, I'll just have to experiment with placement and so forth.
pcook
 
Posts: 3
Joined: Mon Dec 22, 2014 7:00 am


Return to User Forum

Who is online

Users browsing this forum: Google [Bot] and 39 guests