This is a great little mod!
I liked the idea of having it in the header area, but my search needs are a little different so I made some changes. Firstly, I would never use it for searching for a product, so I didn't need that part. I just need to search orders frequently. Sometimes I have an order number, but sometimes I only have a name and vague idea of time, or just a name with no idea of time.
So mine now sits in the header with a field for order number, a field for name, and radio buttons for time periods. There's no submit button since you can just hit enter.
I should also mention that I never use the language selector that appears in that area of the header, so I actually replaced it with the order search. If you use the language selector, be aware that this will make it go away.
I don't know how some people are making images appear in their posts, since the img tag doesn't seem to do it, but here's a link to a snapshot:
http://forum.x-cart.com/attachment.php?attachmentid=659&stc=1&d=1196193934 Snap1.jpg
To do this, I edited skin1/head_admin.tpl. Find the following snippet. If you haven't already modified the file you should find it at lines 15-37, but just be sure you are looking at the whole table row (the <tr> before the '{if' all the way through to the </tr> that comes after the {else}):
Code:
<tr>
<td colspan="2" class="HeadLine" align="right" height="22">
{if ($usertype eq "P" or $usertype eq "A") and $login and $all_languages_cnt gt 1}
<form action="{$smarty.server.REQUEST_URI|amp}" method="post" name="asl_form">
<table cellpadding="0" cellspacing="0">
<tr>
<td><b>{$lng.lbl_current_language}:</b> </td>
<td>
<input type="hidden" name="redirect" value="{$smarty.server.QUERY_STRING|amp}" />
<select name="asl" onchange="javascript: document.asl_form.submit()">
{section name=ai loop=$all_languages}
<option value="{$all_languages[ai].code}"{if $current_language eq $all_languages[ai].code} selected="selected"{/if}>{$all_languages[ai].language}</option>
{/section}
</select>
</td>
</tr>
</table>
</form>
{else}
{/if}
</td>
</tr>
Replace that entire snippet with this one: (After backing up the original, of course)
Code:
<tr>
<td colspan="2" class="HeadLine" align="right" height="22">
{if ($usertype eq "P" or $usertype eq "A") and $login}
<table>
<tr>
<td>
<form name="searchform" action="order.php" method="post">
<table>
<tr>
<td>Order Number:</td>
<td><input name="orderid" type="text" size="10" maxlength="8"></td>
</tr>
</table>
</form>
</td>
<td>
<form name="searchform" action="orders.php" method="post">
<table>
<tr>
<td>Name:</td>
<td><input name="posted_data[customer]" type="text" size="10" maxlength="35"></td>
<td><input name="posted_data[date_period]" value="" checked="checked" type="radio"></td>
<td width="60">All dates</td>
<td><input name="posted_data[date_period]" value="M" type="radio"></td>
<td width="80">This month</td>
<td><input name="posted_data[date_period]" value="W" type="radio"></td>
<td width="80">This week</td>
<td><input name="posted_data[date_period]" value="D" type="radio"></td>
<td width="60">Today</td>
<td width="1"><input type="hidden" id="orderid2" name="orderid2" value=""><input type="hidden" name="posted_data[by_username]" value="on"><input type="hidden" name="posted_data[by_firstname]" value="on"><input type="hidden" name="posted_data[by_lastname]" value="on"><input type="hidden" name="posted_data[address_type]" value="Both"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
{else}
{/if}
</td>
</tr>
I hope somebody finds this useful!!
(By the way, I did this in version 4.1.9. Your mileage may vary in other versions.)
Marshall