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

V4 - auto search using vars in url

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 06-30-2005, 01:23 PM
 
bluski bluski is offline
 

Newbie
  
Join Date: May 2005
Posts: 4
 

Default

Thanks, Cherie for your proper 'get string' code. Much appreciated.

Not to get off the topic too much, but...

is there a simple way to add a word search that searches the content of any/all created pages (pages.php?pageid=1...)?

thanks
__________________
4.1.5 Gold
Reply With Quote
  #22  
Old 07-06-2005, 09:51 AM
  connie's Avatar 
connie connie is offline
 

Advanced Member
  
Join Date: Jul 2004
Posts: 88
 

Default

I wonder if a cutomer wants to refer the search result to his friends, what link can he use? Normally he uses search.php, not auto_search.php
I would like to know how to sort this out too.
__________________
connie
x-cart4.0.14
x-affilate
Reply With Quote
  #23  
Old 07-06-2005, 02:07 PM
 
shirley2005 shirley2005 is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

What is this mod for?
Provide a link for customer to view all products?
__________________
x-cart 4.0.14 Pro
Reply With Quote
  #24  
Old 07-06-2005, 03:00 PM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default

Thanks for the follow up on this, that worked; however, it only searches the first word that's entered for me. i.e. 1&2&3 only searches 1
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
  #25  
Old 07-06-2005, 04:38 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default

Quote:
Originally Posted by bluecat
Thanks for the follow up on this, that worked; however, it only searches the first word that's entered for me. i.e. 1&2&3 only searches 1

This is untested, but as far as I can tell, you simply separate search words with spaces so searching for "1 2 3" would look like:

Code:
...auto_search.php?q=1%202%203

...or more clearly, searching for "firstword secondword thirdword":

Code:
...auto_search.php?q=firstword%20secondword%20thirdword

Again, this is just a guess.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #26  
Old 07-12-2005, 07:54 PM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default

Quote:
Originally Posted by cherie
Quote:
Originally Posted by bluecat
Thanks for the follow up on this, that worked; however, it only searches the first word that's entered for me. i.e. 1&2&3 only searches 1

This is untested, but as far as I can tell, you simply separate search words with spaces so searching for "1 2 3" would look like:

Code:
...auto_search.php?q=1%202%203

...or more clearly, searching for "firstword secondword thirdword":

Code:
...auto_search.php?q=firstword%20secondword%20thirdword

Again, this is just a guess.

That worked perfectly. Thank you VERY MUCH!!
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
  #27  
Old 08-11-2005, 08:13 AM
 
smith smith is offline
 

Newbie
  
Join Date: Jan 2005
Posts: 4
 

Default

Hi

I've used this auto-search MOD for searching a string in the URL. Works great thks, but I'd like to be able to search by category also.

Version 3 uses '&in_category=' but any ideas of how to apply this principle in V4?

Thanks in advance

Xcart 4.013
__________________
smithy

--

Newbie
Reply With Quote
  #28  
Old 08-11-2005, 09:21 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default

Quote:
Originally Posted by smith
I've used this auto-search MOD for searching a string in the URL. Works great thks, but I'd like to be able to search by category also.

Version 3 uses '&in_category=' but any ideas of how to apply this principle in V4?
It appears you just need to add another hidden form field for posted_data[categoryid] and either hardcode the value there or pass it as another variable in your get string. You'd be using the categoryid number.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #29  
Old 08-12-2005, 01:49 AM
 
smith smith is offline
 

Newbie
  
Join Date: Jan 2005
Posts: 4
 

Default

Thanks Cherie. I think I'm getting somewhere!

Is there a way of editing 'Advanced search options' so that 'Main category' & 'Additional category' checkboxes are ticked? I've been delving with 'customer/main/search_result.tpl' but can't see what to change.

Any advice would be appreciated
__________________
smithy

--

Newbie
Reply With Quote
  #30  
Old 08-12-2005, 08:36 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default

Just take a peek at the page source for advanced search. That's all I do. I notice these checkboxes:
Code:
<TD width="5"><INPUT type="checkbox" name="posted_data[category_main]"></TD><TD nowrap>Main category</TD> <TD width="5"><INPUT type="checkbox" name="posted_data[category_extra]"></TD><TD nowrap>Additional category</TD>
so if I wanted to make sure "additional categories" is checked in the auto search then I would just add the following:
Code:
<input type="hidden" name="posted_data[category_extra]" value="yes" />
You can see how "category_extra" is referenced in include/search.php. You can add most of the advanced search fields in this way. You could also pass in another variable in your GET string to turn this on/off.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 10:23 PM.

   

 
X-Cart forums © 2001-2020