Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product search


Gil_e_n

Recommended Posts

At the moment, the search function doesn't seem to search the product description on the website. For example, I have about twelve cranes listed, but the word crane is only in the product description. THerefore, when I search crane, no results show up. Is there a way I can get the search box to search the product descriptions as well? At last resort, I can add the necessary keywords to product name, but it'll really look pretty stupid if you know what the acronyms I have to keep in the product name stand for. As most my visitors will.

Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

Link to comment
Share on other sites

Thank you, but it looks like it only searches the includes/english folder, and my product descriptions aren't there.

Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

Link to comment
Share on other sites

Try this one

based on a solution of simmerl.

 

quick&dirty

open

catalog/includes/boxes/search.php

 

find:

 

$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_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

 

 

change to:

 

 

// IQ 20040610-3-hhaller w013 QuickSearch searches in description, too

if (QUICKSEARCH_IN_DESCRIPTION == 'true') {

$iq_text = '<input type="hidden" name="search_in_description" value="1">';

} else {

$iq_text = '';

}

$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_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

'text' => $iq_text . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

// IQ 20040610-3-hhaller w013 end

 

 

 

Execute this SQL statement:

INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Quicksearch searches in description', 'QUICKSEARCH_IN_DESCRIPTION', 'false', 'If set to TRUE the customer can search in descriptions otherwise the search is limited to the product title', 1, 113, '2004-06-10 16:54:12', '2004-06-10 16:42:11', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

Link to comment
Share on other sites

hello Gillian, the advanced_search_result.php is the one where everything takes place. If you look that file there should be this line

          if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";

so once you tick the box "search in product descriptions" should set the 'search_in_description' variable and return the results from the product description.

Link to comment
Share on other sites

I see. Thank you all. I actually managed to get it working now.

Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

Link to comment
Share on other sites

  • 10 months later...
And how would that be to include attributes search on the quick search infobox?? Can anybody help on this one? Tks in advance.

 

you'd need to check the syntax used from this contrib ...

 

http://www.oscommerce.com/community/contri...arch+attributes

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Tks for your reply, Monika. :)

 

I've been trying to merge these two contributions:

 

Quick Research Infobox with Page Result - http://www.oscommerce.com/community/contributions,3930

Advanced Search - Attributes - http://www.oscommerce.com/community/contributions,2337

 

 

I installed both of them with success but since my php skills are very poor :blush: I just can't find the right way to merge them. Could you please tell me exactly what needs to be changed? Pardon my ignorance and tks in advance for any help.

Patty

Link to comment
Share on other sites

maybe someone else has used them ... it takes a while to read through it and implement, and I wish I had the time, but not today ...

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...