You are here:  » If one product go to the productpage

Support Forum



If one product go to the productpage

Submitted by esogut on Wed, 2008-01-02 12:00 in

Hi David,

Is it possible to if a search or category or a brand has one search result than to redirect that search page to the product-page

Submitted by support on Wed, 2008-01-02 12:18

Hi,

Yes - this is easy to do. In search.php, look for the following code (line 154):

  require("html/header.php");

To perform the redirect if there is only 1 result, change as follows:

  if ($resultCount == 1)
  {
    header("Location: ".$config_baseHREF.$searchresults["products"][0]["productHREF"]);
    exit();
  }
  require("html/header.php");

That should do the trick!
Cheers,
David.