Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search Check-Box


JangoF

Recommended Posts

Hi,

 

I am looking for a simple modification of the standard search infobox. Basically I want a check box that does one thing: Searches in the Description of the items. If the checkbox has been checked, then it should search only 

in product description, if it's off, it should search only in the product titles.

 

After a bit of testing I have the following code:

 

<script type="text/javascript">

<!--

 

function searchvalidate_form ( )

{

valid = true;

 

if ( document.quick_find.search_check.checked == "true" )

{

<?php

$desc = tep_draw_hidden_field('search_in_description', '1');

?>

valid = true;

}

else

{

<?php

$desc = tep_draw_hidden_field('search_in_description', '0');

?>

valid = true;

 

}

 

return valid;

}

//-->

</script>

 

<!-- 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, 'onsubmit="return searchvalidate_form ( );"', 'NONSSL', false), 'get'),

'align' => 'left',

'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . $desc . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . tep_draw_checkbox_field('search_check', $value = 'true', $checked = false, $parameters = '') . 'Search in Description?<br><br><a href="http://mysite.com/help.php"><b>Click Here For Search Tips</b></a>');

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- search_eof //-->

 

However, it still does not work properly. It does not search in the product description. Can anyone help?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...