Single result redirect
Using some simple template code, you can tell the search results to redirect the customer to an alternative page when only yielding one item.
<? if (count($this->results->results->result) == 1): ?>
<script type="text/javascript">window.location = 'http://www.domain.com/<?= $this->results->results->result[0]->code ?>.html';</script>
<? endif ?>
<? if (count($this->results->results->result) == 1 && preg_match("#^[0-9\-]+#", trim($this->query)) && !stristr($_SERVER['HTTP_REFERER'], 'http://www.domain.com/' . $this->results->results->result[0]->url . '.html')): ?>
<script type="text/javascript">
if ('#j8djasl4' != window.location.hash) {
window.location += '#j8djasl4';
window.location.href = 'http://www.domain.com/<?= $this->results->results->result[0]->url ?>.html';
}
</script>
<? endif ?>
*You will need to make sure you modify the "window.location" url correctly. In this case, it would be the url structure for the product page.