You are here:  » search for merchant and keyword

Support Forum



search for merchant and keyword

Submitted by babrees on Wed, 2009-07-22 16:33 in

I would like to do a hyperlink to a search for specific products from specific merchant.

ie www.mydomain.co.uk/search.php?q= merchant + keyword

How would I do this please?

ta
Jill

Submitted by support on Wed, 2009-07-22 17:10

Hi Jill,

The merchant: search operator supports additional keywords - which you can provide after a second ":", for example:

search.php?q=merchant:Some+Merchant:Keyword1+Keyword2

(spaces are encoded as + in URLs)

Cheers,
David.

Submitted by babrees on Wed, 2009-07-22 21:08

Thanks David

I was so close! I just didn't put the + in!

---------
Jill

Submitted by darren on Tue, 2011-01-04 11:10

Hi David

This seemed like the answer to my prayers but I can't get it to work - for example:
{link saved}

I know I'm missing something really obvious - I just don't know what? :)
This is version 11/09A

Cheers

Darren

Submitted by support on Tue, 2011-01-04 11:32

Hi Darren,

In search.php, look for the following code at line 88:

      $where .= " ".$field." = '".database_safe($parts[$i])."' ";

...and REPLACE with:

      if ($field)
      {
        $where .= " ".$field." = '".database_safe($parts[$i])."' ";
      }
      else
      {
        $where .= " name LIKE '%".database_safe($parts[$i])."%' ";
      }
      $field = "";

...and then the example query you're using will work as expected...

Cheers,
David.
--
PriceTapestry.com

Submitted by darren on Tue, 2011-01-04 11:52

Cheers David

That certainly does the trick - I'm assuming if I change the same line in search external than that will work the same?

Thanks

Darren

Submitted by support on Tue, 2011-01-04 11:54

Hi Darren,

Yes - should work exactly the same.

Cheers,
David.
--
PriceTapestry.com

Submitted by darren on Tue, 2011-01-04 12:07

And indeed it does.

Many thanks