X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Quick Search Boxes in Admin Header (https://forum.x-cart.com/showthread.php?t=41237)

jaydee 07-20-2008 11:28 PM

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.)

carlisleglass 07-21-2008 11:21 PM

Re: Quick Search Boxes in Admin Header
 
Add the following to it as well to be able to access order details quicker :

Code:

<form action="order.php">
    Order ID: <input type="text" name="orderid">
    &nbsp;&nbsp;<input type="submit" name="go" value="Go" />
</form>


Thedae2k 07-24-2008 12:25 AM

Re: Quick Search Boxes in Admin Header
 
nice useful mod...thx

sunset 08-25-2008 07:11 AM

Re: Quick Search Boxes in Admin Header
 
Brilliant! Thank you so much!


All times are GMT -8. The time now is 07:00 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.