X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Search by OrderId or Name (https://forum.x-cart.com/showthread.php?t=54461)

Vacman 07-03-2010 02:43 PM

Search by OrderId or Name
 
Ok - This was something we had in our old 4.1.8 X Cart. Makes looking up customer's orders much easier.

Edit skin1/head_admin.tpl

Around line 55 - just past this code:

Code:


                    {foreach from=$all_languages item=l}
                  <option value="{$l.code}"{if $current_language eq $l.code} selected="selected"{/if}>{$l.language}</option>
                {/foreach}
              </select>
            </td>
          </tr>
        </table>
      </form>
    {else}


but before:

Code:

      &nbsp;
    {/if}
</td>
</tr>


Insert this code:

Code:


{*    Search by OrderId or Customer Name *}
      <table>
        <form name="searchform" action="order.php" method="post">
            <tr>
              <td>Order Number:</td>
              <td><input name="orderid" type="text" size="10" maxlength="8"></td>
              </form>
              <form name="searchform" action="orders.php" method="post">
                <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 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">&nbsp;</td>
              </form>
            </tr>
      </table>


Now you will be able to look up your customer's Order by their orderid or last name.

If you do not mind it being a little crowded you can also insert this in there to quickly search for a product:
Code:

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


amy2203 07-04-2010 09:54 PM

Re: Search by OrderId or Name
 
great mod, I think this will be very useful.

I also added a class to the form elements (class="inlineform") and added this css to the skin1_admin.css file
Code:

.inlineform {
display: inline;
}


so now it all fits in one line in the top bar. I'm also thinking of adding a customer search here as well maybe.

Thanks for a great mod.

Vacman 07-04-2010 10:04 PM

Re: Search by OrderId or Name
 
Since I am a newb to the .css stuff, I added the lines to the css file, and then I tried to put the class call inside the form element...?

Like this...

Code:

<form class="inlineform" method="post" action="search.php" name="searchform">

I didn't see any difference.

amy2203 07-04-2010 10:10 PM

Re: Search by OrderId or Name
 
1 Attachment(s)
are all the forms in 1 line? your's might have been like that anyway, I'm only on 4.1.12, here's my head_admin bit:
Code:

{*    Search by OrderId or Customer Name *}
 
        <form  class="inlineform" name="searchform" action="order.php" method="post">
         
              Order Number:
              <input name="orderid" type="text" size="10" maxlength="18">
              </form>
              <form class="inlineform" name="searchform" action="orders.php" method="post">
                Customer Name:
                <input name="posted_data[customer]" type="text" size="10" maxlength="35">
                <input name="posted_data[date_period]" value="" checked="checked" type="radio">
                All dates
                <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">&nbsp;
              </form>
           
     
     
              <form class="inlineform" 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="10" name="posted_data[substring]" />
                &nbsp;&nbsp;SKU:&nbsp;<input type="search" class="search" size="10" name="posted_data[productcode]" />
                &nbsp;&nbsp;<input type="submit" name="submit" value="Search" />
        </form>


and the css:
Code:

.inlineform {
display: inline;
}


Vacman 07-04-2010 10:33 PM

Re: Search by OrderId or Name
 
Ah - got it - I had screwed up the class name... I like your idea better. Thanks for contributing.

Vacman 03-09-2013 03:55 PM

Re: Search by OrderId or Name
 
Update for people running 4.5.5:

First, I will acknowledge that this is not ideal. I still have not figured out how to get this where I want it - but at least it works.

Ideally, I would love to see this in the black bar at the top of the page to the right of the Goodies tab and under the Search Keywords input box. If you can figure it out, please post it here.

1. Make a new file and place it in the the /skin/common_files/admin directory. I called mine my_search.tpl.
2. Copy the above posted code for whatever search stuff you want.
3. Edit the /common_files/single/menu_box.tpl and on the very last line in that file put :
{include file="admin/my_search.tpl"}

That is it! Its ugly - I know this already. But it works.


All times are GMT -8. The time now is 11:57 AM.

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