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
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
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.
cheers David,
Haven't tested an new query yet, but has transferred of to existing, Thanks again
Paul
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
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
Hi Paul,
There shouldn't be a leading ":" in the query; have a go with:
$_GET["q"] = "category:XXXX:merchant:XXXX XXXXXX";
Cheers,
David.
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
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.