Question Regarding Search Capabilities

General ShopSite user discussion

Question Regarding Search Capabilities

Postby malljess » Sat Oct 22, 2011 7:45 am

I have ShopSite manager. I have two categories of items that I am selling. I want to set up a search within a category so that only items in the particular category show up on the search results page. Can this be done in manager?

Thank you..
malljess
 
Posts: 50
Joined: Sat Oct 22, 2011 7:38 am

Re: Question Regarding Search Capabilities

Postby Jim » Sat Oct 22, 2011 9:15 am

Manager stores (at least the latest version) have advanced search settings so it should be possible to do. With the advanced search you can use Wildcards and Boolean Operators to specify what is returned for a search. (Help at: http://shopsite.com/help/11.0/en-US/sc/mgr/advanced.search.help.html ) To limit search results to a particular category you would have to include unique single word term in one of the indexable fields that would not be found in indexed fields for products that do not belong to that category. Then your search text would be something like
<term> AND other words . So if you have a category "jackets" and that is in the product description and you want to find jackets with zippers you would use
jackets AND zippers.

Looking in a Version 11 sp1 manager store the extra field don't appear to be indexable so you would only be able to use
Name
SKU
Description
More Info Text
Ordering Options Pull-down Menus
Ordering Options SKUs
Ordering Options Appended Text
Google Merchant Center Brand
Google Merchant Center Product Type

to contain your unique category term. Pro level stores have a Search Keywords field and allow the 25 extra product fields to be indexed so there is more flexibility in where you could put unique search term but other than that Manager should be able to do the same type of searches.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Question Regarding Search Capabilities

Postby malljess » Sat Oct 22, 2011 9:37 am

Would the search word that indicates category need to be put in by the person conducting the search or can it be programed in the search code so when the visitor searches for jacket zippers he only has to put zipper in. I am looking for certain search bars to return certain items without the vistor having to enter the category. Thanks for your help.
malljess
 
Posts: 50
Joined: Sat Oct 22, 2011 7:38 am

Re: Question Regarding Search Capabilities

Postby Jim » Sat Oct 22, 2011 11:17 am

If you are creating the form yourself, I'm pretty sure that you could code the form so that it automatically includes the category. That wouldn't be possible using the default ShopSite search forms.

Here is a search form I copied off a page using the Curved theme.
<form action="http://domain.com/cgi-bin/sc/productsearch.cgi?storeid=*1c486dea1006f776d00d17fbb4f06990" method="get">
<p class="search nobr">
<input name="storeid" value="*1c486dea1006f776d00d17fbb4f06990" type="hidden">
Search<br><input name="search_field" class="search" size="17" type="text">&nbsp;

<input src="http://domain.com/11sp1/shopsite-images/en-JA/backgrounds/curved/arrow.gif" name="add to cart" style="margin-bottom: -3px;" type="image">
</p>
</form>

The object is to get both the category term and AND included in the search_field value which comes from the text box.

So if you insert the following line in the form before the text field it will also be added to the search_field value box. (NOTE replace "category_name" with the category specific value, eg jacket.)
<input name="search_field" type="hidden" value="category_name AND ">
to a search form I copied off of a page using the Curved theme.

So the form becomes
<form action="http://domain.com/cgi-bin/sc/productsearch.cgi?storeid=*1c486dea1006f776d00d17fbb4f06990" method="get">
<p class="search nobr">
<input name="storeid" value="*1c486dea1006f776d00d17fbb4f06990" type="hidden">
<input name="search_field" type="hidden" value="category_name AND ">
Search<br><input name="search_field" class="search" size="17" type="text">&nbsp;

<input src="http://domain.com/11sp1/shopsite-images/en-JA/backgrounds/curved/arrow.gif" name="add to cart" style="margin-bottom: -3px;" type="image">
</p>
</form>

I have not actually tried this but I'm pretty sure that should work. Note that you will probably need to set the Advance Search to Always on Preferences > Search Settings > Search Layout otherwise the AND would be considered a word and not a Boolean term.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Question Regarding Search Capabilities

Postby malljess » Fri Dec 09, 2011 8:10 pm

I have included the code below to search products using a defined category and a search term.

I get this:

No products for the search: ebook7351 AND ,suicide

there is a "," before the search term that I can't figure out how to get rid of.

The page is http://www.nationalcenterseminars.com/ebooks.htm

The code is below:

<form action="http://www.nationalcenterseminars.com/cgi-bin/sc/productsearch.cgi?storeid=*0ed69f920d6a6d0afa" method="get">
<input type=hidden name="storeid" value="*0ed69f920d6a6d0afa">
<p align="left"><font color="#660000"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Keywords</font></b><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
<input type="hidden" name="search_field" value="ebook7351 AND ">

<input type="text" name="search_field" size="40" class="search" >&nbsp;
</font></font> <font color="#660000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
</font>
<p align="left"><font color="#660000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Author</b><br>

<input type="text" name="search_field" size="40" value="" onFocus="value=''">
<BR>
<p align="left"><b>ISBN Number</b><br>

<input type="text" name="search_field" size="40" value="" onFocus="value=''">
<BR>
<BR>
<input name="submit" type="submit" value="Search for a Title">

<BR>
</font> </form></td>

As always Thanks.
malljess
 
Posts: 50
Joined: Sat Oct 22, 2011 7:38 am

Re: Question Regarding Search Capabilities

Postby Jim » Sat Dec 10, 2011 3:24 am

When you have multiple input values of the same name in a form, they are submitted as a comma separated list. So the only way to get rid of the comma is to have the entire content of the form field for each input name added as a single input instead of multiples. You could probably do that with javascript but I don't know exactly how it is done.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 110 guests