Hi,
To get the name of the previous/ next element, you will have to edit the file "components/com_hikashop_views_product/view.html.php" function "show()" and replace:
if(!empty($articles)){
foreach($articles as $k => $article){
if($article == $element->product_id || $article == $element->product_parent_id){
$links->path= JURI::root();
$links->path .= 'media/com_hikashop/images/icons/';
$class = hikashop_get('class.product');
if(!isset($category_pathway)){
$pathway = '';
}else{
$pathway = $pathway_sef_name.'='.$category_pathway;
}
if($k != 0){
$p = $k - 1;
$id_previous = $articles[$p];
$elt = $class->get($id_previous);
$class->addAlias($elt);
$pathway_sef_name = $config->get('pathway_sef_name','category_pathway');
$links->previous = hikashop_completeLink('product&task=show&cid='.(int)$id_previous.'&name='.$elt->alias.'&'.$pathway.$url_itemid);
}
$n = $k;
while(isset($articles[$n]) && ($articles[$n]==$element->product_id||$articles[$n]==$element->product_parent_id)){
$n = $n + 1;
}
if(isset($articles[$n])){
$id_next = $articles[$n];
$elt = $class->get($id_next);
$class->addAlias($elt);
$pathway_sef_name = $config->get('pathway_sef_name','category_pathway');
$links->next = hikashop_completeLink('product&task=show&cid='.(int)$id_next.'&name='.$elt->alias.'&'.$pathway.$url_itemid);
}
break;
}
}
}
By:
$links->previousName = '';
$links->nextName = '';
if(!empty($articles)){
foreach($articles as $k => $article){
if($article == $element->product_id || $article == $element->product_parent_id){
$links->path= JURI::root();
$links->path .= 'media/com_hikashop/images/icons/';
$class = hikashop_get('class.product');
if(!isset($category_pathway)){
$pathway = '';
}else{
$pathway = $pathway_sef_name.'='.$category_pathway;
}
if($k != 0){
$p = $k - 1;
$id_previous = $articles[$p];
$elt = $class->get($id_previous);
$class->addAlias($elt);
$pathway_sef_name = $config->get('pathway_sef_name','category_pathway');
$links->previous = hikashop_completeLink('product&task=show&cid='.(int)$id_previous.'&name='.$elt->alias.'&'.$pathway.$url_itemid);
$links->previousName = $elt->alias;
}
$n = $k;
while(isset($articles[$n]) && ($articles[$n]==$element->product_id||$articles[$n]==$element->product_parent_id)){
$n = $n + 1;
}
if(isset($articles[$n])){
$id_next = $articles[$n];
$elt = $class->get($id_next);
$class->addAlias($elt);
$pathway_sef_name = $config->get('pathway_sef_name','category_pathway');
$links->next = hikashop_completeLink('product&task=show&cid='.(int)$id_next.'&name='.$elt->alias.'&'.$pathway.$url_itemid);
$links->nextName = $elt->alias;
}
break;
}
}
}
And then edit the view "product / sqhow" via the menu Display > Views, and display the name which will be in the variable:
$this->links->previousName and $this->links->nextName
Be careful, the changes made in the view.html.php file will be lost at each update.
We will improve the code to make it easiest to get some values of the next and previous products in the future.