![]() |
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 |
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"> </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> |
Re: Copy search box to non-cart pages
Thanks, Paul, that worked perfectly!
|
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.
|
Re: Copy search box to non-cart pages
Paul,
How do you reference the file search.php correctly in the form action? Thank you. |
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.