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)
-   -   Copy search box to non-cart pages (https://forum.x-cart.com/showthread.php?t=34189)

CobaltCat 09-26-2007 07:12 PM

Copy search box to non-cart pages
 
Is it possible to copy the search utility from X-Cart and add it to any non-cart pages so it can search from outside the cart?

v 4.1.8

pauldodman 09-27-2007 02:26 AM

Re: Copy search box to non-cart pages
 
Yes, just extract the form code and put it in your page, and make sure you reference the file search.php correctly in the form action:

<TABLE width="100%" height="1" border="0" cellpadding="0" cellspacing="0" align="right" valign="top">
<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>
<TD align="right">Search<INPUT type="text" name="posted_data[substring]" size="20"> </TD>
<td width="10">&nbsp;</td>
<TD width="23"><A href="javascript: document.productsearchform.submit()">Go</A></TD>
</TR>
<TR>
<TD colspan="3" align="right" valign="top">
<A href="/equine/search.php" class="SmallLink">Advanced Search</A>
</TD>
</TR>
</FORM>
</TABLE>

CobaltCat 09-28-2007 01:33 AM

Re: Copy search box to non-cart pages
 
Thanks, Paul, that worked perfectly!

longhorn180 09-28-2007 05:46 AM

Re: Copy search box to non-cart pages
 
How about the advanced search. Is there a way to put that on another page? I have not been succesful at getting it to work.

auc 10-23-2009 09:12 AM

Re: Copy search box to non-cart pages
 
Paul,

How do you reference the file search.php correctly in the form action?

Thank you.

pauldodman 10-26-2009 01:47 AM

Re: Copy search box to non-cart pages
 
Crikey, that's a while back, Jeff ;)

Basically, we are looking at this line:
<FORM method="POST" action="search.php" name="productsearchform">

within which is "search.php" - so what you need to do here, is change the link so that wherever you put this form, it can still find search.php

Maybe adding http://yourdomain.com/search.php
or http://yourdomain.com/store/search.php

or ../search.php

something like that, just so it can find the file from wherever it is.


All times are GMT -8. The time now is 01:23 AM.

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