Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modification to the quick search box


puzzlezone

Recommended Posts

Posted

Hello all :)

 

I used a mod to make my search box always act as an "advanced search" so it would search through product descriptions as a default. This works fine.

 

Now my box has a link at the bottom of it that says "advanced search" that takes people to the now redundant advanced search page.

 

I'd like to make the link read "search" and have it just begin the search. How do I go about this?

 

I'm guessing it has to do with the search.php file, and probably this bit of code:

 

'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 . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

 

 

In addition, I'm still learning PHP, so if you could maybe explain this code a bit. I understand everything up till here:

 

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

[/code]

 

Can someone break down what this function is doing? I know it creates the link, but I don't understand how it's doing it.

 

Thanks!

Posted
Hello all :)

 

I used a mod to make my search box always act as an "advanced search" so it would search through product descriptions as a default. This works fine.

 

Now my box has a link at the bottom of it that says "advanced search" that takes people to the now redundant advanced search page.

 

I'd like to make the link read "search" and have it just begin the search. How do I go about this?

 

I'm guessing it has to do with the search.php file, and probably this bit of code:

 

'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 . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

In addition, I'm still learning PHP, so if you could maybe explain this code a bit. I understand everything up till here:

 

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

[/code]

 

Can someone break down what this function is doing? I know it creates the link, but I don't understand how it's doing it.

 

Thanks!

 

Basically, it works like any html link:

 

<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><

 

This is the link. You will find (FILENAME_ADVANCED_SEARCH) which is a variable defined in catalog/includes/filenames.php

 

If you comment out that line of code the advanced search link will disappear.

Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!!

 

Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience.

 

The quickest way to learn is to forget to BACKUP!

  • 2 months later...
Posted

Will you please show me exaclty where to comment this out? I have tried several options, and the bold Advanced Search still shows.

 

Thank you

 

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

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 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_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);
?>
           </td>
         </tr>
<!-- search_eof //-->

 

 

Thank you for your help!

Archived

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

×
×
  • Create New...