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

Copy search box to non-cart pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-26-2007, 07:12 PM
  CobaltCat's Avatar 
CobaltCat CobaltCat is offline
 

Senior Member
  
Join Date: Jul 2003
Location: Southern Orygun
Posts: 153
 

Default 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
__________________
Thanks -
CobaltCat

I would love to change the world, but they won't give me the source code.
Reply With Quote
  #2  
Old 09-27-2007, 02:26 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default 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>
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #3  
Old 09-28-2007, 01:33 AM
  CobaltCat's Avatar 
CobaltCat CobaltCat is offline
 

Senior Member
  
Join Date: Jul 2003
Location: Southern Orygun
Posts: 153
 

Default Re: Copy search box to non-cart pages

Thanks, Paul, that worked perfectly!
__________________
Thanks -
CobaltCat

I would love to change the world, but they won't give me the source code.
Reply With Quote
  #4  
Old 09-28-2007, 05:46 AM
 
longhorn180 longhorn180 is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Richmond, Virginia
Posts: 187
 

Default 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.
__________________
4.1.9 (Linux) Live Store
www.thecrackedbook.com
Find used books and out of print books.
Reply With Quote
  #5  
Old 10-23-2009, 09:12 AM
 
auc auc is offline
 

Member
  
Join Date: Jul 2007
Posts: 10
 

Default Re: Copy search box to non-cart pages

Paul,

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

Thank you.
__________________
All USA Catalog
X-Cart Gold 4.1.9
Reply With Quote
  #6  
Old 10-26-2009, 01:47 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default 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.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
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 02:52 PM.

   

 
X-Cart forums © 2001-2020