defined('_JEXEC') or die;
$link = $name = null;
$sef = JFactory::getConfig()->get('sef') ;
$hk_link = 'index.php?option=com_hikashop&ctrl=product&task=show&cid=';
?>
<section class="search-results">
<?php foreach ($this->results as $result) {
if(!empty($result->image)){
if($sef==1) {
$link = JRoute::_($result->href);
}
else{
$link = JRoute::_($hk_link . $result->id . '&name=' . $result->product_alias);
}
$name = explode (' ',$result->product_name);
$i = 0;
?>
<div class="search-result hk-products">
<h4 class="hk-product-name"><a href="<?php echo $link; ?>"><?php foreach($name as $n){
$i++;
if($i==1){
echo '<span class="hk-product-name-main">' .$n. '</span>';
} else{
echo $n . ' ' ;
}
} ?></a></h4>
<figure class="hk-product-img">
<a href="<?php echo $link; ?>">
<img class="hk-product-thumb" src="<?php echo $result->image; ?>" />
</a>
</figure>
</div>
<?php }
}
?>
</section>