Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Search by OrderId or Name

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-03-2010, 02:43 PM
  Vacman's Avatar 
Vacman Vacman is offline
 

X-Adept
  
Join Date: Sep 2005
Location: Torrance, CA
Posts: 792
 

Default 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>
__________________
Carl Tice

X-Cart 4.6.6
X-Payments 3.0
ReBOOT 3.4.1

PHP 5.6.30
MySQL 5.6.35
Linux 2.6.32-042stab120.18
ionCube PHP Loader v4.7.3
Perl 5.10.1
Reply With Quote

The following user thanks Vacman for this useful post:
amy2203 (07-04-2010)
  #2  
Old 07-04-2010, 09:54 PM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default 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.
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #3  
Old 07-04-2010, 10:04 PM
  Vacman's Avatar 
Vacman Vacman is offline
 

X-Adept
  
Join Date: Sep 2005
Location: Torrance, CA
Posts: 792
 

Default 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.
__________________
Carl Tice

X-Cart 4.6.6
X-Payments 3.0
ReBOOT 3.4.1

PHP 5.6.30
MySQL 5.6.35
Linux 2.6.32-042stab120.18
ionCube PHP Loader v4.7.3
Perl 5.10.1
Reply With Quote
  #4  
Old 07-04-2010, 10:10 PM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Re: Search by OrderId or Name

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; }
Attached Thumbnails
Click image for larger version

Name:	Picture 4.png
Views:	121
Size:	9.8 KB
ID:	2002  
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!

Last edited by amy2203 : 07-04-2010 at 10:12 PM. Reason: add screenshot
Reply With Quote
  #5  
Old 07-04-2010, 10:33 PM
  Vacman's Avatar 
Vacman Vacman is offline
 

X-Adept
  
Join Date: Sep 2005
Location: Torrance, CA
Posts: 792
 

Default Re: Search by OrderId or Name

Ah - got it - I had screwed up the class name... I like your idea better. Thanks for contributing.
__________________
Carl Tice

X-Cart 4.6.6
X-Payments 3.0
ReBOOT 3.4.1

PHP 5.6.30
MySQL 5.6.35
Linux 2.6.32-042stab120.18
ionCube PHP Loader v4.7.3
Perl 5.10.1
Reply With Quote
  #6  
Old 03-09-2013, 03:55 PM
  Vacman's Avatar 
Vacman Vacman is offline
 

X-Adept
  
Join Date: Sep 2005
Location: Torrance, CA
Posts: 792
 

Default 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.
__________________
Carl Tice

X-Cart 4.6.6
X-Payments 3.0
ReBOOT 3.4.1

PHP 5.6.30
MySQL 5.6.35
Linux 2.6.32-042stab120.18
ionCube PHP Loader v4.7.3
Perl 5.10.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:40 AM.

   

 
X-Cart forums © 2001-2020