You are here:  » searchExternal results from specific brand, category or merchant


searchExternal results from specific brand, category or merchant

Submitted by bat on Mon, 2014-05-05 14:29 in

Hi David,
I've searched the forum but unable to see an answer.

When using searchExternal, I sometimes want to show search results of a keyword from a specific merchant, brand or categoy. How would I be able to do so?

At the moment, I've got this:

$common_baseHREF = "http://www.example.com/";
$common_path = "/path/to/example/site/";
$_GET["q"] = "dress";
require($common_path."searchExternal.php");

so lets say I wanted to show only dresses from a merchant named New Look. What would be the code for that please?

Thanks.

Submitted by support on Tue, 2014-05-06 09:18

Hi bat,

Sure - to add support for $_GET["merchantFilter"], edit your current version of searchExternal.php and look for the following code:

  if ($q)

...and REPLACE with:

  $merchantFilter = (isset($_GET["merchantFilter"])?$_GET["merchantFilter"]:"");
  if ($merchantFilter)
  {
    $priceWhere .= " AND merchant = '".database_safe($merchantFilter)."' ";
  }
  if ($q)

Then use the calling code;

$common_baseHREF = "http://www.example.com/";
$common_path = "/path/to/example/site/";
$_GET["q"] = "dress";
$_GET["merchantFilter"] = "New Look";
require($common_path."searchExternal.php");

Cheers,
David.
--
PriceTapestry.com

Submitted by bat on Wed, 2014-05-07 17:06

Excellent. Works a treat. Thanks David!