Print Page | Close Window

Customized Store Search Code

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=2721
Printed Date: 29-September-2024 at 12:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Customized Store Search Code
Posted By: roknrod12
Subject: Customized Store Search Code
Date Posted: 07-May-2009 at 3:05pm
I'm wondering if anyone has tweaked the store search code to eliminate the searching of product descriptions? Basically, I'm wanting to allow the customer the option of searching product titles (name) only, much like the ebay search (in titles & descriptions). Has anyone attempted this?   Any help would be greatly appreciated.

Thanks in advance,
Rodney



Replies:
Posted By: whizzinpc
Date Posted: 08-May-2009 at 11:36am
This is something we would like to do also.


Posted By: avalight
Date Posted: 08-May-2009 at 5:05pm
You can limit your search in the small search box by SKU, so I don't know why you couldn't do it for the Product Name too.  I think the field name is for the product is called "description", but under this post is the way to do it for the SKU.  I followed this plus a little tweaking and got it to work on my site http://www.avalanche-ranch.com.  Upper right corner.

-------------
Curt


Posted By: roknrod12
Date Posted: 08-May-2009 at 5:11pm
avalight - thanks for the reply. I thought the same thing, but according to EI support, 'it will require altering the complex query used by the the advanced search feature.' What exactly did you alter to limit yours?


Posted By: avalight
Date Posted: 08-May-2009 at 7:11pm
Well, I just used the small search box snippet that is in the Header.asp file.  Just like in the post.

-------------
Curt


Posted By: roknrod12
Date Posted: 18-August-2009 at 10:13am
avalight -

Did you mean to put a link to a post? You mentioned a post a couple of times, but no reference.


Posted By: avalight
Date Posted: 18-August-2009 at 11:16am
Ah, right, sorry.  I see the reason for the question.  I think if I read this forum in the morning when I am fresh, vs. the late, late evening, things would be clearer...anyway, the post that I am referring to is this one:  http://www.earlyimpact.com/forum/forum_posts.asp?TID=1979 - http://www.earlyimpact.com/forum/forum_posts.asp?TID=1979 , which talks about how to make the search box only look for the SKU.  I followed those instructions, including the change in the showsearchqueary.asp, and made some further modifications shown below, mostly to help users know what they can type in the box. 

<!-- Start Search Box -->
   <form action="http://www.avalanche-ranch.com/rusticlighting/pc/showsearchresults.asp" name="search" method="get" class="pcForms">
   <input type="hidden" name="pageStyle" value="<%=bType%>">
   <SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; COLOR: rgb(0,161,0);">PRODUCT SEARCH:</span>
   <input type="hidden" name="resultCnt" value="10">
   <input type="Text" name="SKU" size="14" value="Enter Product No." onclick="this.value=''">
    <b><input type="image" name="submit" src="/rusticlighting/PC/images/btn_go_gray.gif" id="submit"></b>
    </form>
<!-- End Search Box -->

Hope this helps.
Best



-------------
Curt


Posted By: roknrod12
Date Posted: 18-August-2009 at 11:20am
Thanks, avalight! I'll check this out.


Posted By: worldofrugs
Date Posted: 19-August-2009 at 10:44am
What I did is I took the showsearchresults.asp, made a copy (showsearchresultsB.asp) and refered to this new page when I needed it (for example your own form).

When looking at the code, you will see in this file line like:
tmpSQL=tmpSQL  & TestWord & " A.details LIKE "
tmpSQL2=tmpSQL2 & TestWord & " A.description LIKE "
tmpSQL3=tmpSQL3 & TestWord & " A.sDesc LIKE "

How I started on this file, was to change all thos lines to search only the ones I wanted...
Example, searching only in the Name (title) of the product:
tmpSQL=tmpSQL  & TestWord & " A.description LIKE "
tmpSQL2=tmpSQL2 & TestWord & " A.description LIKE "
tmpSQL3=tmpSQL3 & TestWord & " A.description LIKE "

I tested it and got the result I needed. Then I cleaned it up, removing the duplicate queries / string (or whatever you call them haha)...

As I am not a guru ASP coder, this is probably not the best way to go, but it works great!

(note: I'm using v3.12a, so look into the code with other versions)

Hope this is what you were looking for or maybe helps you on your way...


Posted By: roknrod12
Date Posted: 19-August-2009 at 12:48pm
worldofrugs - you win! That worked perfectly! Now I've got more refined searches on our site. Thanks a bunch!


Posted By: worldofrugs
Date Posted: 19-August-2009 at 12:58pm
Glad I could help Clap

Just keep in mind to clean up this code a little... (I learned the hard way)
I just changed them without taking the duplicates away, and while this went good 90% of the time, it did occasionally time out on the search (not to mention it took 4 ever for the results to come up!)
I then removed the duplicates and voila! Perfect going Wink



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net