Для магазина будет так:
в типовой динамической (lib_6.php которая)
полностью код типовой динамической не привожу - он у меня изменен под нужды проекта, а часть за показ предыдущего/следущего товара привожу: (ориентироваться на самый последний else при поиске куда разместить нижеследующий код)
else
{
/* =Следущий/предыдущий товар*/
$mas = $shop->GetShop($current_shop_id);
$order_field = $mas['shop_sort_order_field'];
$order_type = $mas['shop_sort_order_type'];
switch ($order_field)
{
default:
case 0:
$name_field = 'shop_items_catalog_date_time';
break;
case 1:
$name_field = 'shop_items_catalog_name';
break;
case 2:
$name_field = "shop_items_catalog_order , shop_items_catalog_name";
break;
}
switch ($order_type)
{
default:
case 0:
$order_field = 'Asc';
break;
case 1:
$order_field = 'Desc';
break;
}
$DataBase = & singleton('DataBase');
$prev = false;
$next = false;
$current_date = date('Y-m-d H:i:s');
$current_group = intval($GLOBALS['shop_item_path']['group']);
$query = "SELECT SQL_CALC_FOUND_ROWS DISTINCT shop_items_catalog_table.shop_items_catalog_item_id, `shop_items_catalog_modification_id`
FROM shop_items_catalog_table
LEFT JOIN shop_groups_table
ON shop_items_catalog_table.shop_groups_id = shop_groups_table.shop_groups_id
WHERE shop_items_catalog_table.shop_shops_id = '$current_shop_id'
AND shop_items_catalog_table.shop_items_catalog_is_active = '1'
AND (shop_items_catalog_table.shop_items_catalog_putend_date >= '$current_date'
OR shop_items_catalog_table.shop_items_catalog_putend_date ='0000-00-00 00:00:00')
AND shop_items_catalog_table.shop_items_catalog_putoff_date <= '$current_date'
AND (shop_items_catalog_table.shop_groups_id = '$current_group')
ORDER BY $name_field $order_field LIMIT 0, 9999";
$result = $DataBase->select($query);
while ($row = mysql_fetch_assoc($result))
{
if ($row['shop_items_catalog_item_id'] == to_int($GLOBALS['shop_item_path']['item']))
{
$next_row = mysql_fetch_assoc($result);
$next = $next_row['shop_items_catalog_item_id'];
break;
}
$prev = $row['shop_items_catalog_item_id'];
}
$item_info = $shop->GetItem($prev);
$item_path = $item_info['shop_items_catalog_path'];
if($item_path != '')
{
$external_propertys['PrevName'] = $item_info['shop_items_catalog_name'];
$external_propertys['PrevLink'] = $item_path;
}
$item_info = $shop->GetItem($next);
$item_path = $item_info['shop_items_catalog_path'];
if($item_path != '')
{
$external_propertys['NextName'] = $item_info['shop_items_catalog_name'];
$external_propertys['NextLink'] = $item_path;
}
/* =/Следущий/предыдущий товар*/
/* Вывод конкретного элемент */
//$param['show_catalog_item_type'] = array('active', 'inactive');
$param['xml_show_group_type'] = 'tree';
$param['current_group_id'] = $GLOBALS['shop_item_path']['group'];
// Запрещаем передачу в XML свойств групп
$param['xml_show_group_property'] = false;
/* Вывод конкретного элемент */
$shop->ShowItem($GLOBALS['shop_item_path']['item'], $xsl_item, $param, $external_propertys);
}
}
?>
И в xsl шаблоне "МагазинТовар" добавляем в нужном месте
<div class="prevnext">
<div class="prev">
<xsl:choose>
<xsl:when test="/shop/PrevLink !=''">
<a href="{/shop/path}{//group[@id=$parent_group_id]/fullpath}{/shop/PrevLink}/">« Предыдущий товар</a>
</xsl:when>
<xsl:otherwise>
<span>« Предыдущий товар</span>
</xsl:otherwise>
</xsl:choose>
</div>
<div class="next">
<xsl:choose>
<xsl:when test="/shop/NextLink !=''">
<a href="{/shop/path}{//group[@id=$parent_group_id]/fullpath}{/shop/NextLink}/">Следующий товар »</a>
</xsl:when>
<xsl:otherwise>
<span>Следующий товар »</span>
</xsl:otherwise>
</xsl:choose>
</div>
</div>