Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is There An Easy Way Tp Put Search In The Header?


glusniffer1

Recommended Posts

Ive looked all over and did find some but when I finish reading the posts they have nothing but problems...Im looking to put my search bar into the header...This is a live store so I would like to keep it simple....

The Hobby Undergound..."For The Pure Hobbyist"

Link to comment
Share on other sites

The following code will do it for you

  <td class="main" align="left" valign="top">
      <p>
     <form name="quick_find" action="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'SSL'); ?>" method="get">
           Search <input type="hidden" name="osCsid" value="" />
     <input type="text" name="keywords" value="Type word(s) and press enter" onFocus="form.keywords.value='';" size="
     27" maxlength="35" style="" >
     <input type="hidden" name="osCsid" value="">

     <?php echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH, '', 'NONSSL') . '">' .  'Advanced Search' . '</a>'; ?>

      </form>
     </td>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

OK what file do I put this in? My Header? and roughly were?

 

 

The following code will do it for you
 ?<td class="main" align="left" valign="top">
? ? ? <p>
? ? ?<form name="quick_find" action="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'SSL'); ?>" method="get">
? ? ? ? ? ?Search <input type="hidden" name="osCsid" value="" />
? ? ?<input type="text" name="keywords" value="Type word(s) and press enter" onFocus="form.keywords.value='';" size="
? ? ?27" maxlength="35" style="" >
? ? ?<input type="hidden" name="osCsid" value="">

? ? ?<?php echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH, '', 'NONSSL') . '">' . ?'Advanced Search' . '</a>'; ?>

? ? ? </form>
? ? ?</td>

 

Jack

The Hobby Undergound..."For The Pure Hobbyist"

Link to comment
Share on other sites

You'll need to edit the includes/header.php file. Find where the logo is being displayed and place it next to that. You'll have toplay around with the table to get it exactly where you want it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You can also put

<?php require(DIR_WS_BOXES . 'search.php'); ?>

in your header where you want the box to show up, but you will have to take out the <tr><td> and </<td></tr> tags or add <table> </table> on the search.php or it will mess up tables.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

You can also put

<?php  require(DIR_WS_BOXES . 'search.php'); ?>

in your header where you want the box to show up, but you will have to take out the <tr><td> and </<td></tr> tags or add <table> </table> on the search.php or it will mess up tables.

 

I tried to strip the search infobox of just the text and the search button but I can't get rid of the spaces on the top and bottom, as well as the huge width.

 

http://www.vpperformance.com if you want an example.

Link to comment
Share on other sites

The following code will do it for you
  <td class="main" align="left" valign="top">
      <p>
     <form name="quick_find" action="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'SSL'); ?>" method="get">
           Search <input type="hidden" name="osCsid" value="" />
     <input type="text" name="keywords" value="Type word(s) and press enter" onFocus="form.keywords.value='';" size="
     27" maxlength="35" style="" >
     <input type="hidden" name="osCsid" value="">

     <?php echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH, '', 'NONSSL') . '">' .  'Advanced Search' . '</a>'; ?>

      </form>
     </td>

 

Jack

 

Jack, your method works well, but could you tell me how I'd insert a picture after the search box that would search the contents inside the text box?

Link to comment
Share on other sites

Jack, your method works well, but could you tell me how I'd insert a picture after the search box that would search the contents inside the text box?

 

<td align="left"><?php

echo '<table><td class="header">' . tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'), tep_draw_input_field('keywords', '', 'size="15" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . '</td><td>' . tep_hide_session_id() . tep_image_submit('searchbutton.jpg', BOX_HEADING_SEARCH) . '</td></tr></table>';
?></td>
</td>

 

Try that. It's a friggen frankenstein code mixed from 4 different sources but it works beautifully, you just need to set a picture in your includes/languages/english/images/buttons/searchbutton.jpg.

 

You can either make a file and throw it in that directory, or make a different file and throw it in that directory, but make sure to change the "searchbutton.jpg" in the code above.

 

Sorry for the sloppy code, but it works! :P

Link to comment
Share on other sites

All I want is the search box I have to be moved to the header area where my store banner is.....Which one of these versions of code do I need to use?

 

Yep, so don't use that, tends to mess up other random parts of the website.

The Hobby Undergound..."For The Pure Hobbyist"

Link to comment
Share on other sites

Change the code I gave you before to this

  <td class="main" align="left" valign="top">
     <p>
    <form name="quick_find" action="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'SSL'); ?>" method="get">
          Search <input type="hidden" name="osCsid" value="" />
    <input type="text" name="keywords" value="Type word(s) and press enter" onFocus="form.keywords.value='';" size="
    27" maxlength="35" style="" >
    <input type="hidden" name="osCsid" value="">
    <?php echo tep_image_submit('button_quick_find.gif', IMAGE_BUTTON_SEARCH) ?> 
     </form>
    </td>

Change the image to whatever you want.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...