You are here:  » search results

Support Forum



search results

Submitted by Paul1107 on Sat, 2009-04-04 18:20 in

Appreciate that this may be a stupid question, but is there a way you can have a search where you can call a specific category from a specific merchant.

So if I wanted to show "blue widgets" category results, but only from the "general widget Co." is that possible using the external.php code?

Couldn't see it posted anywhere else?

Cheers
Paul

Submitted by support on Mon, 2009-04-06 07:43

Hi Paul,

Just as you may have seen in this thread, it's quite easy to modify the search code to support slightly more exotic queries. In this case, likewise look for the following code within the case: merchant etc. section of external.php, around about line 295:

if (isset($parts[2])) if ($parts[2]) $where .= "AND search_name LIKE '%".database_safe(tapestry_search($parts[2]))."%'";

...and REPLACE this with:

if (isset($parts[2]))
{
  if ($parts[2]=="merchant")
  {
    $where .= "AND merchant = '".database_safe($parts[3])."'";
  }
  elseif($parts[2])
  {
    $where .= "AND search_name LIKE '%".database_safe(tapestry_search($parts[2]))."%'";
  }
}

With that in place, you would now be able to preset $_GET["q"] in your calling code using something like:

  $_GET["q"] = "category:Some Category:merchant:Some Merchant"

Cheers,
David.

Submitted by Paul1107 on Tue, 2009-04-07 18:27

Hi David,

Tried above, and got the following warning, though had some existing pages using original calls, would I have to change all those in order for it to work?

Parse error: syntax error, unexpected T_IS_EQUAL in /homepages/45/d229581650/htdocs/mystore/external.php on line 293

Regards

paul

Submitted by support on Tue, 2009-04-07 18:35

Hi Paul,

My apologies - the following line:

if ($parts[2])=="merchant")

...should be:

if ($parts[2]=="merchant")

I've also corrected the post above.

Cheers,
David.

Submitted by Paul1107 on Tue, 2009-04-07 19:57

cheers David,

Haven't tested an new query yet, but has transferred of to existing, Thanks again

Paul

Submitted by Paul1107 on Fri, 2009-04-10 10:47

Hi David,

Following on from earlier, as I stated, updated the coding and all seams to be OK, though I've just tried a search query as follows, but no results show, not even an error message.

The category I've used is a mapped category, just wonder whether it needs to be the actual category embedded into the feed?

<?php
 $external_baseHREF 
"http://www.s229581664.websitehome.co.uk/mystore/";
 
$external_path "/kunden/homepages/45/d229581650/htdocs/mystore/";
 if (!
$_GET["q"] && !$_GET["r"] && !$_GET["merchant"])
 {
   
$_GET["q"] = "category:Going Out Dresses:merchant:Lipsy Partydresses";
   
$_GET["sort"] = "priceDesc";
   
$_GET["maxPrice"] = "1000";
  
$_GET["minPrice"] = "20";
 }
 require(
$external_path."external.php");
?>

cheers Paul

Submitted by support on Fri, 2009-04-10 12:36

Hi Paul,

Could you email me your external.php and i'll check it out for you...

Cheers,
David.

Submitted by Paul1107 on Thu, 2009-06-11 18:55

Hi David,

Further to this thread, and "exotic" searches... I know we got this resolved, but do you know any reason why I can't get any results for the following search query

$_GET["q"] = ":category:XXXX:merchant:XXXX XXXXXX";

Considering I know the category and merchant are correct, no error message or anything, just no results?

Cheers

Paul

Submitted by support on Fri, 2009-06-12 09:30

Hi Paul,

There shouldn't be a leading ":" in the query; have a go with:

$_GET["q"] = "category:XXXX:merchant:XXXX XXXXXX";

Cheers,
David.

Submitted by Paul1107 on Fri, 2009-06-12 13:37

Hi David,

I'm afraid that it still doesn't show?

the code is as follows:

$_GET["q"] = "category:Dress:merchant:Motel Clothing";

I tried it also with lowercase also, but with no luck?

Regards

Paul

Submitted by support on Fri, 2009-06-12 13:52

Hi Paul,

If you email me your modified search.php i'll take a look for you!

Cheers,
David.