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)
-   -   search box on the side (https://forum.x-cart.com/showthread.php?t=19717)

thundernugs 02-04-2006 12:48 AM

search box on the side
 
searched for a while but didn't see this already done, so here is my mod for a search box that utilizes the left hand side menu

create file "sidesearch.tpl"
Code:

{* $Id: sidesearch.tpl 2006/02/04 mteam *}

{capture name=menu}

<TABLE border="0" cellpadding="0" cellspacing="0"> 
<FORM method="POST" action="search.php" name="productsearchform">
<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">

<tr align=center>
 <TD valign="middle">
  <INPUT type="text" name="posted_data[substring]" size="16"

value="{$search_prefilled.substring|escape}">
 </TD>

 <TD valign="middle">
  <A href="javascript: document.productsearchform.submit()">{include

file="buttons/search_head.tpl"}</A>
 </TD>
</tr>
<tr align=center>

  <TD colspan=2 height=25><U>{$lng.lbl_advanced_search}</U></TD>
</TR>
</FORM>
</TABLE>
{/capture}
{ include file="menu.tpl" menu_title=$lng.lbl_search menu_content=$smarty.capture.menu}


then, put this in your home.tpl where you want the search box to go:

Code:

{ include file="customer/sidesearch.tpl" }

then, i removed this from my head.tpl

Code:


<TR>
<TD class="HeadLine" height="22">
{if $usertype eq "C"}
{ include file="customer/search.tpl" }
{/if}
</TD>



<TD class="HeadLine" align="right">
{if ($usertype eq "C" || $usertype eq "B")and $all_languages_cnt gt 1}

<TABLE border="0" cellpadding="0" cellspacing="0">
<FORM action="home.php" method="GET" name="sl_form">
<INPUT type="hidden" name="redirect"

value="{$smarty.server.PHP_SELF}?{$smarty.server.QUERY_STRING}">

<TR>
<TD>
{$lng.lbl_select_language}:
<SELECT name="sl" onChange="javascript: document.sl_form.submit()">
{section name=ai loop=$all_languages}
<OPTION value="{$all_languages[ai].code}"{if $store_language eq $all_languages[ai].code}

selected{/if}>{$all_languages[ai].language}</OPTION>
{/section}
</SELECT>
</TD></TR>

</FORM>
</TABLE>
{else}

{/if}
</TD>
</TR>


you could remove more or less, depending on what you use up there.

hope this helps someone, let me know if it doesn't work as it should

mike

balinor 03-29-2006 09:49 AM

Moving to custom mods.

typologist 08-05-2007 09:11 AM

Re: search box on the side
 
Thanks, it was useful. I included this search in the same box that my manufacturers. Much better organized now ;)


All times are GMT -8. The time now is 05:45 AM.

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