View Single Post
  #1  
Old 07-20-2008, 11:28 PM
 
jaydee jaydee is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 37
 

Thumbs up Quick Search Boxes in Admin Header

Here's a mod I slapped together using code from this forum. It puts a search box in the header of your admin area so you can quickly finds products according to name or SKU.

http://i254.photobucket.com/albums/hh92/jaydee423/Picture3.png

In head_admin.tpl in your skin directory, after

Code:
{if $login ne ""}

add:

Code:
<td align="center"> <form method="post" action="search.php" name="searchform"> <input type="hidden" name="simple_search" value="Y" /> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[by_title]" value="Y" /> <input type="hidden" name="posted_data[by_shortdescr]" value="Y" /> <input type="hidden" name="posted_data[by_fulldescr]" value="Y" /> <input type="hidden" name="posted_data[including]" value="any" /> <input type="hidden" name="posted_data[by_sku]" value="Y" /> Product:&nbsp;<input type="search" size="30" name="posted_data[substring]" /> &nbsp;&nbsp;SKU:&nbsp;<input type="search" class="search" size="20" name="posted_data[productcode]" /> &nbsp;&nbsp;<input type="submit" name="submit" value="Search" /> </form> </td>

Done!

I left out the code that puts the search result back in the search box as this makes it quicker to do another search as you don't have to clear the field. If you want it back, add this to the input fields:

Code:
value="{$search_prefilled.substring|escape}"

Nothing flash, but oh-so handy!!

I tried to add a category drop down list, but it started taking me too long so if anybody's got any suggestions, do tell!

(Originally for 4.1.9.)
__________________
jd.
-
X-Cart Gold 4.1.9
Red-Hat Server
Reply With Quote