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

Search queries via a URL in version 4.0.x!!
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 12-06-2005, 07:07 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Man
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 2,893
 

Default Search queries via a URL in version 4.0.x & 4.1.x!!

I know a lot of you need to have links to search results (like the old x-cart versions could). Now you can with this very simple mod!

In search.php (in your main X-cart directory, not in the include folder!) Find the following code:
Code:
x_session_register("search_data");

Insert this code AFTER the code you found above:
Code:
# BCSE begin if($search) { $search_data['products']['substring']=$search; $mode="search"; } # BCSE end

To use this mod just point your browser to urls like this:
http://yourdomain.com/search.php?search=SEARCHQUERYHERE

If you need spaces in the query to include multiple words use + inbetween like this:
http://yourdomain.com/search.php?search=SEARCH+QUERY+HERE

Hope this helps some of you!

Carrie

Note this works in 4.1.x as well!!
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #2  
Old 12-07-2005, 11:28 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Oooooo....nice! This gets asked for all the time....thanks Carrie!!!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 12-07-2005, 02:41 PM
  More-Japan's Avatar 
More-Japan More-Japan is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 107
 

Default

Thank you very much! I've been recently testing 4.0.17 and noticed that issue. Perfect!

What would be the syntax for searching in specific extra fields?
__________________
Version 5.2.13

http://www.more-japan.com/
Reply With Quote
  #4  
Old 12-13-2005, 06:47 AM
  swordmart's Avatar 
swordmart swordmart is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 35
 

Default Thx

Thx, was just what i was looking for.
__________________
X-cart 4 gold
PHP version 4.3.10
MySQL version 4.0.23-standard
Apache version 1.3.33 (Unix)
Reply With Quote
  #5  
Old 12-20-2005, 12:28 PM
  More-Japan's Avatar 
More-Japan More-Japan is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 107
 

Default

Anyone have an example of the syntax to properly query an extra fields search that is linkable?

search.php?substring=somekindofsearch

i'm thinking it's adding something like:

&in_extrafields=13??

But I don't know...someone, please enlighten me!
__________________
Version 5.2.13

http://www.more-japan.com/
Reply With Quote
  #6  
Old 12-20-2005, 01:14 PM
  swordmart's Avatar 
swordmart swordmart is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 35
 

Default

Just a thought but dont some search engines let you have a file in root dir with a list of URL's? Ive seen this on some search engines, but not sure which ones.

Would it be possable to make a huge list of URL's using the new URL's function so i can have many more links on those search engines?

Not sure if im way of mark, just a thought.
Jamie
__________________
X-cart 4 gold
PHP version 4.3.10
MySQL version 4.0.23-standard
Apache version 1.3.33 (Unix)
Reply With Quote
  #7  
Old 12-20-2005, 02:43 PM
  More-Japan's Avatar 
More-Japan More-Japan is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 107
 

Default

Are you talking about a sitemap?

if so, sitemaps are common and can be beneficial to help the spiders crawl. I know there are a few sitemap mods floating around here.
__________________
Version 5.2.13

http://www.more-japan.com/
Reply With Quote
  #8  
Old 12-07-2006, 06:04 PM
 
Latat Latat is offline
 

Member
  
Join Date: Aug 2005
Location: Hungary
Posts: 25
 

Default Re: Search queries via a URL in version 4.0.x!!

Hi,

I've just installed and works well. Is there any possibility to use 'OR' separator word in search (as in google and oscommerce)?

Example: http://www.yourdomains.com/search.php?search=tv+or+radio

This way the search result would show products contains word tv in the product name and products contains word radio in the product name.

Regs,

Laszlo

X-cart Gold, 4.019 Linux
Reply With Quote
  #9  
Old 01-18-2007, 05:40 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Default Re: Search queries via a URL in version 4.0.x!!

Nice one Carrie; works in 4.1.3
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #10  
Old 01-31-2007, 12:09 PM
  CobaltCat's Avatar 
CobaltCat CobaltCat is offline
 

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

Default Re: Search queries via a URL in version 4.0.x!!

This works great in 4.1.5, thanks!

How do I set up a URL that will search only the keywords field?
__________________
Thanks -
CobaltCat

I would love to change the world, but they won't give me the source code.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:23 AM.

   

 
X-Cart forums © 2001-2018