Home | Store | osCommerce Tutorials

osCommerce Quick Find Content File Structure

Actually the file structure and design of all osCommerce Box Content are almost the same. We have discussed the file structure of osCommerce Box Content in previous tutorials. Therefore we will only go through briefly.

Open the includes/boxes/search.php file.

The following lines of codes are used to display the Quick Find Content.

$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_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>');

new infoBox($info_box_contents);

Look! The code structure is same as other osCommerce box contents.

The filename of FILENAME_ADVANCED_SEARCH_RESULT is defined in the catalog/includes/filenames.php file (line 24) as advanced_search_result.php:

define('FILENAME_ADVANCED_SEARCH_RESULT', 'advanced_search_result.php');

Therefore, when visitors enter a search term and enter the search button, the catalog/advanced_search_result.php file process the searching.

osCommerce quick find

The picture below shows the search result content with the catalog/advanced_search_result.php file:

osCommerce quick find

Let's recall the web layout of the Search Result:

osCommerce search result web layout

Take a look at some of the codes of catalog/advanced_search_result.php:

Header Table:

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE_2; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_browse.gif', HEADING_TITLE_2, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table>

The 1st column of Header Table is the Heading Title (HEADING_TITLE_2). The HEADING_TITLE_2 is defined in catalog/includes/languages/english/advanced_search.php (line 17):

define('HEADING_TITLE_1', 'Advanced Search');
define('HEADING_TITLE_2', 'Products meeting the search criteria');

The 2nd column is the search result image icon (table_background_browse.gif):

osCommerce search result icon

The other codes are mainly used to query the osCommerce database and display the searched result records one by one on the web page.

This is the end of osCommerce Quck Find Box Content tutorial.