Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with the Search Facility


mystifier_uk

Recommended Posts

When I search my site it will only find products with the keywords that are in the title of a product, not words that are found in the product description.

 

Is it supposed to do this?

 

And if so is there a way to have the search look through the description of the products instead? :blink:

 

Any help would be appreciated!

Link to comment
Share on other sites

Ok so no promises here but I'm going to TRY and help you.

 

I have a funny idea that it's got something to do with your "advanced_search.php" file (I presume you have that).

 

If you could possibly copy&paste what you have in it and send it as a private message I'll try and spot any mistakes in it which may be causing this error?

 

Otherwise I might not know.

 

Regards,

Tim?

I am Tim? and Tim? is me!

Link to comment
Share on other sites

Ok and also, when you searched did you use the Advanced Search option and also ticked the "Search product descriptions" box or not?

 

I do believe that the normal search box doesn't allow a search of descriptions, but the advanced one does.

I am Tim? and Tim? is me!

Link to comment
Share on other sites

When I search my site it will only find products with the keywords that are in the title of a product, not words that are found in the product description.

 

Is it supposed to do this?

 

And if so is there a way to have the search look through the description of the products instead? :blink:

 

Any help would be appreciated!

 

Hi there

 

You can have the search seach in descriptions. Try using this instead of for your includes/boxes/search.php file

 

<?php
/*
 $Id: search.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- search //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_SEARCH);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
						   'align' => 'center',
						   'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_draw_hidden_field('search_in_description','1') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '
[url="%27%20.%20tep_href_link%28FILENAME_ADVANCED_SEARCH%29%20.%20%27"][b]' . BOX_SEARCH_ADVANCED_SEARCH . '[/b][/url]');

 new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- search_eof //-->

 

This should make the search box search in the descriptions as well.

Backup before making changes. Backup before making changes! Backup before making changes!!

 

You did do a backup? eh?

Link to comment
Share on other sites

Thanks for that - it works great! :thumbsup:

 

One problem with the code though - the advanced search option under the box is no longer clickable.

 

How do I make this a URL to advanced search, or alternatively how could I removed that piece of text.

 

To see what I mean, check out my site and scroll down to the quick search option on the left navigation column:

 

http://www.watchstrapsuk.com/

Link to comment
Share on other sites

Thanks for that - it works great! :thumbsup:

 

One problem with the code though - the advanced search option under the box is no longer clickable.

 

How do I make this a URL to advanced search, or alternatively how could I removed that piece of text.

 

To see what I mean, check out my site and scroll down to the quick search option on the left navigation column:

 

http://www.watchstrapsuk.com/

 

Yeah you are right. Sorry about that. Did you keep the original file the answer must be in there.

Backup before making changes. Backup before making changes! Backup before making changes!!

 

You did do a backup? eh?

Link to comment
Share on other sites

Now that I look at the code I gave you there is a mistake. Try replacing:

BOX_SEARCH_TEXT . '

[ul=%27%20.%20tep_href_link%28FILENAME_ADVANCED_SEARCH%29%20.%20%27]' . BOX_SEARCH_ADVANCED_SEARCH . '[/url]');

 

With:

 

BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

Backup before making changes. Backup before making changes! Backup before making changes!!

 

You did do a backup? eh?

Link to comment
Share on other sites

Works like a charm! Thanks a lot guys - brilliant stuff! :thumbsup:

 

Great!! Glad it's fixed up.

Backup before making changes. Backup before making changes! Backup before making changes!!

 

You did do a backup? eh?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...