X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Search queries via a URL in version 4.0.x!! (https://forum.x-cart.com/showthread.php?t=18488)

BCSE 12-06-2005 07:07 PM

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!!

balinor 12-07-2005 11:28 AM

Oooooo....nice! This gets asked for all the time....thanks Carrie!!!

More-Japan 12-07-2005 02:41 PM

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?

swordmart 12-13-2005 06:47 AM

Thx
 
Thx, was just what i was looking for.

More-Japan 12-20-2005 12:28 PM

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!

swordmart 12-20-2005 01:14 PM

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

More-Japan 12-20-2005 02:43 PM

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.

Latat 12-07-2006 06:04 PM

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

Warwick 01-18-2007 05:40 AM

Re: Search queries via a URL in version 4.0.x!!
 
Nice one Carrie; works in 4.1.3 :)

CobaltCat 01-31-2007 12:09 PM

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?


All times are GMT -8. The time now is 03:14 PM.

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