Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Simple Search Box


Guest

Recommended Posts

Simple_Search_Box_v2.1

 

How can I get this contribution to search through both the titles AND desciptions?

 

Someone help please :'(

 

 

Thanks in advance!

 

~Roq

 

 

For those that dont have the code in front of them:

 

 

?>
<script>
function clearDefault(el) {
 if (el.defaultValue==el.value) el.value = ""
}
</SCRIPT>
<form name="quick_find" action="advanced_search_result.php" method="get">

	  <table>
		<tr>
			<td>
				<div>
					<!-- This is the input box where visitors enter keywords etc -->
					<input type="text" name="keywords" value="Keyword Search" size="20" ONFOCUS="clearDefault(this)" class="textsmall">
				</div>
			</td>
			<td>
				<div>
					<!-- OSC Search Submit Button Below -->
					<?php echo tep_image_submit('button_go-search.gif', BOX_HEADING_SEARCH); ?>
					<!-- Default Gray Search Submit Button Below -->
					<!--<input type="submit" name="search" value="go" class="formfield" border="0" width="5" height="5" />-->
				</div>
			</td>
		</tr>
	  </table>

</form>

Link to comment
Share on other sites

I realize I am the only one responding to this thread, but I have yet to find a solution.

 

Please HELP me before I break something trying to do it myself!

 

Thanks

 

~Roq

Link to comment
Share on other sites

  • 2 weeks later...

I thought I should help you before you get bored and stop posting in this thread :D

 

open catalog/includes/boxes/search2.php

 

FIND:

 

<input type="text" name="keywords" value="Search" size="30" ONFOCUS="clearDefault(this)">

 

ADD BELOW:

 

<input type="hidden" name="search_in_description" value="1" />
<input type="hidden" name="inc_subcat" value="1" />

 

save the file.

 

This searches in product descriptions and also all the sub categories which I thought you would probably prefer to have.

 

Enjoy.

Santa's little freelancer

Link to comment
Share on other sites

I thought I should help you before you get bored and stop posting in this thread :D

 

This searches in product descriptions and also all the sub categories which I thought you would probably prefer to have.

 

Enjoy.

 

 

Thank you thank you thank you!!!!

 

Nimz, you have made my day! Works like a charm and having it search through descriptions and subs is exactly what I wanted!

 

You are a life saver! :thumbsup:

 

Cheers!

 

~Roq

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...