Search within a brand
Hi,
Is it possible with search external to search for products within a brand so something like "brand:sony&tv" ?
Cheers,
Chris.
Hi David,
That works great within Price Tapestry but doesn't seem to work with searchExternal.php
I'm calling it with the normal:
<?php
$common_baseHREF = "http://www.example.com/pricetapestry/";
$common_path = "/path/to/pricetapestry/";
$_GET["q"] = "brand:sony:name:tv";
require($common_path."searchExternal.php");
?>
Cheers,
Chris.
Hi Chris,
searchExternal.php contains the full search logic in its own right so the same modification would be required in that file. The corresponding lines are 118 for the first modification; and 142 for the second. If you're not sure, email me the searchExternal.php that you are using and I'll make the changes for you..
Cheers,
David.
Hi David,
I have read a few times on the forum about a searchExternal that includes pagination and also one that includes products displayed in a grid format is there a searchExternal available that combines both the grid format and pagination?
Cheers,
Chris.
You'll need the full external.php to do that; i'll email it to you now along with the grid version of the search results HTML module...
Cheers,
David.
Hi David,
Would it be possible to incorporate another field from my feeds in PT? I have a field which is 'gender' and a I'd love to be able to search externally for something like:
brand:blah:category:blah blah:gender:womens
Cheers,
Chris.
Hello Chris,
Sure - if you could email me your search.php and external.php (if you want the same functionality in that) i'll add the code for you...
Cheers,
David.
Hi Chris,
Sure - it's straight forward to add the the brand: search handler. In search.php, look for the following code on line 64:
$fields = array("merchant","category","brand");...and REPLACE with:
$fields = array("merchant","category","brand","name");And then look for the following code on line 94:
$where .= " ".$field." = '".database_safe($parts[$i])."' ";...and REPLACE with:
if ($field == "name"){
$where .= " ".$field." LIKE '%".database_safe($parts[$i])."%' ";
}
else
{
$where .= " ".$field." = '".database_safe($parts[$i])."' ";
}
With that in place, you can then search using, for example:
brand:sony:name:tvAlternatively, as would already be in place without the above modifications; you can always link to:
brand:sony:category:Televisionsetc.
Cheers,
David.