Рейтинг и ссылки на выдаче поиска
Здравствуйте. Необходима помощь по настройке пары моментов за вознаграждение -)
1. Вывести рейтинг товаров в полученном списке на поиске
Пробовал код вывода рейтинга в списке товаров группы ( как тут ) , ошибка на ошибке.
2. Настроить ссылку на товар. Везде приписывает site.ru/SEARCH/......
3. и почему то в корзину не добавляется товар именно с поиска
--------------------------------------------------------------
ICQ: 5544432
-----------------
Все это дело машаню тут
XSL Поиска
1. Вывести рейтинг товаров в полученном списке на поиске
Пробовал код вывода рейтинга в списке товаров группы ( как тут ) , ошибка на ошибке.
2. Настроить ссылку на товар. Везде приписывает site.ru/SEARCH/......
3. и почему то в корзину не добавляется товар именно с поиска
--------------------------------------------------------------
ICQ: 5544432
-----------------
Все это дело машаню тут
XSL Поиска
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="Windows-1251" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
<xsl:decimal-format name="my" decimal-separator="," grouping-separator="."/>
<xsl:template match="/">
<xsl:apply-templates select="/document"/>
</xsl:template>
<xsl:template match="/document">
<!-- Ссылка на добавление в корзину -->
<SCRIPT>
<xsl:comment>
<xsl:text disable-output-escaping="yes">
<![CDATA[
function set_count_mod(input_id, step)
{
var oCountMod = document.getElementById(input_id);
if (!(iCurrCount = parseInt(oCountMod.value))) {
iCurrCount = 0;
}
if (!(iCurrCount <= 0 && step < 0)) {
oCountMod.value = iCurrCount + step;
}
}
]]>
</xsl:text>
</xsl:comment>
</SCRIPT>
<!-- Форма поиска -->
<form method="get" action="/search/">
<input type="text" size="50" name="text" value="{search_query}" maxlength="200" class="input_buttom_search"/>
 
<input type="submit" class="input_buttom_search_button" value="Искать"/>
</form>
<xsl:if test="search_query!=''">
<p>
<strong>Найдено <xsl:value-of select="count_items"/> <xsl:call-template name="declension">
<xsl:with-param name="number" select="count_items"/></xsl:call-template></strong>
</p>
<!--<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td width="30"></td>
<td width="300"><b>Наименование</b></td>
<td width="130"><b>Артикул</b></td>
<td width="150"><b>Производитель</b></td>
<td width="100"><b>Цена</b></td>
</tr>
</table>-->
<xsl:if test="count_items!=0">
<div start="{(current_page - 1) * items_on_page + 1}">
<xsl:apply-templates select="item">
</xsl:apply-templates>
</div>
<!-- Строка ссылок на другие страницы результата поиска -->
<p>
<xsl:call-template name="for">
<xsl:with-param name="items_on_page" select="items_on_page"/>
<xsl:with-param name="current_page" select="current_page - 1"/>
<xsl:with-param name="count_items" select="count_items"/>
<xsl:with-param name="visible_pages">5</xsl:with-param>
</xsl:call-template>
<div style="clear: both"></div>
</p>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="item">
<div>
<xsl:choose>
<!-- Если магазин (page_module = 3) и тип элемента товары (page_module_value_type = 2) -->
<xsl:when test="page_module = 3 and page_module_value_type = 2">
<xsl:apply-templates select="item" mode="shop" />
</xsl:when>
<xsl:otherwise>
<a href="{page_address}">
<xsl:value-of select="page_name"/>
</a>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
<!-- Шаблон для товара -->
<xsl:template match="item/item" mode="shop">
<!-- Определяем цвет фона -->
<xsl:variable name="background_color">
<xsl:choose>
<xsl:when test="(position() + 1) mod 2 > 0">#f7f7f7</xsl:when>
<xsl:otherwise>#ffffff</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div>
<table class="items">
<tbody>
<tr>
<td class="ls">
<div class="photo">
<xsl:if test="small_image != ''">
<a href="{/shop/path}{fullpath}" >
<img src="{small_image}" style="border: 1px solid #DADADA; margin: 0px 5px 5px 0px" alt="{name}" title="{name}"/>
</a>
</xsl:if>
</div>
<b><xsl:value-of disable-output-escaping="yes" select="name"/></b>
<hr />
<div class="descrs">
<xsl:value-of disable-output-escaping="yes" select="description"/>
<xsl:if test="count(group) > 1">
<xsl:apply-templates select="group" mode="sub_group"/>
</xsl:if>
</div>
</td>
<td class="rs">
<div class="prices">
<!-- Цена товара -->
<xsl:choose>
<xsl:when test="price != 0">
<xsl:variable name="pric" select="price"/>
<span>
<xsl:value-of select="format-number($pric, '###.##0,00', 'my')"/> 
<!-- Валюта товара -->
<xsl:value-of disable-output-escaping="yes" select="currency"/>
</span>
</xsl:when>
<xsl:otherwise>
<b>цена договорная</b>
</xsl:otherwise>
</xsl:choose>
<!-- Если цена со скидкой - выводим ее -->
<xsl:if test="price!=price_tax">
<br/>
<font color="gray">
<strike>
<xsl:variable name="pric_tax" select="price_tax"/>
<xsl:value-of select="format-number($pric_tax, '###.##0,00', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="currency"/>
</strike>
</font>
</xsl:if>
</div>
<div class="artics">
<xsl:if test="marking_of_goods != ''">
<p>Артикул: <b><xsl:value-of disable-output-escaping="yes" select="marking_of_goods"/></b></p>
</xsl:if>
</div>
<div class="compares">
<input type="text" size="2" value="1" id="count_{@id}"/>
<img src="/images/map_intocart.gif" width="12" height="21" border="0" usemap="#mapInToCart{@id}" style="margin: 0 0 -5px 1px;"/>
<map name="mapInToCart{@id}">
<area shape="rect" coords="0,0,12,10" onclick="set_count_mod('count_{@id}', 1);" nohref="nohref" />
<area shape="rect" coords="0,11,12,21" onclick="set_count_mod('count_{@id}', -1);" nohref="nohref" />
</map>
</div>
<div class="bottons">
<a href="{/shop/path}cart/?action=add&item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}').value)">
<img alt="В корзину" title="В корзину" src="/hostcmsfiles/images/cartcl.gif" style="margin: 0px 0px -4px 10px" />
</a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</xsl:template>
<xsl:template name="page_address" match="text()">
<xsl:param name="str" select="."/>
<xsl:param name="max">50</xsl:param>
<xsl:param name="hvost">10</xsl:param>
<xsl:param name="begin">
<xsl:choose>
<xsl:when test="string-length($str) > $max">
<xsl:value-of select="substring($str, 1, $max - $hvost)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($str, 1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="end">
<xsl:choose>
<xsl:when test="string-length($str) > $max">
<xsl:value-of select="substring($str, string-length($str) - $hvost + 1, $hvost)"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="result">
<xsl:choose>
<xsl:when test="$end != ''">
<xsl:value-of select="concat($begin, '…', $end)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$begin"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:value-of disable-output-escaping="yes" select="$result"/>
</xsl:template>
<!-- Цикл для вывода строк ссылок -->
<xsl:template name="for">
<xsl:param name="i" select="0"/>
<xsl:param name="prefix">page</xsl:param>
<xsl:param name="items_on_page"/>
<xsl:param name="current_page"/>
<xsl:param name="count_items"/>
<xsl:param name="visible_pages"/>
<xsl:variable name="n" select="$count_items div $items_on_page"/>
<!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
<xsl:variable name="parent_group_id" select="/document/blocks/parent_group_id"/>
<!-- Считаем количество выводимых ссылок перед текущим элементом -->
<xsl:variable name="pre_count_page">
<xsl:choose>
<xsl:when test="$current_page > ($n - (round($visible_pages div 2) - 1))">
<xsl:value-of select="$visible_pages - ($n - $current_page)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Считаем количество выводимых ссылок после текущего элемента -->
<xsl:variable name="post_count_page">
<xsl:choose>
<xsl:when test="0 > $current_page - (round($visible_pages div 2) - 1)">
<xsl:value-of select="$visible_pages - $current_page - 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="round($visible_pages div 2) = ($visible_pages div 2)">
<xsl:value-of select="$visible_pages div 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$count_items > $items_on_page and $n > $i">
<!-- Определяем адрес ссылки -->
<xsl:variable name="number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="$i != 0">&<xsl:value-of select="$prefix"/>=<xsl:value-of select="$i + 1"/></xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Ставим ссылку на страницу-->
<xsl:if test="$i != $current_page">
<!-- Выводим ссылку на первую страницу -->
<xsl:if test="$current_page - $pre_count_page > 0 and $i = 0">
<a href="./?text={search_query_url}" class="page_link" style="text-decoration: none;">←</a>
</xsl:if>
<xsl:choose>
<xsl:when test="$i >= ($current_page - $pre_count_page) and ($current_page + $post_count_page) >= $i">
<!-- Выводим ссылки на видимые страницы -->
<a href="./?text={search_query_url}{$number_link}" class="page_link">
<xsl:value-of select="$i + 1"/>
</a>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
<!-- Выводим ссылку на последнюю страницу -->
<xsl:if test="$i+1 >= $n and $n > ($current_page + 1 + $post_count_page)">
<xsl:choose>
<xsl:when test="$n > round($n)">
<!-- Выводим ссылку на последнюю страницу -->
<a href="./?text={search_query_url}&{$prefix}={round($n+1)}" class="page_link" style="text-decoration: none;">→</a>
</xsl:when>
<xsl:otherwise>
<a href="./?text={search_query_url}&{$prefix}={round($n)}" class="page_link" style="text-decoration: none;">→</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:if>
<!-- Ссылка на предыдущую страницу для Ctrl + влево -->
<xsl:if test="$current_page != 0 and $i = $current_page">
<xsl:variable name="prev_number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="($current_page - 1) != 0">&<xsl:value-of select="$prefix"/>=<xsl:value-of select="$i"/></xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="./?text={search_query_url}{$prev_number_link}" id="id_prev"></a>
</xsl:if>
<!-- Ссылка на следующую страницу для Ctrl + вправо -->
<xsl:if test="($n - 1) > $current_page and $i = $current_page">
<a href="./?text={search_query_url}&{$prefix}={$current_page+2}" id="id_next"></a>
</xsl:if>
<!-- Не ставим ссылку на страницу-->
<xsl:if test="$i = $current_page">
<span class="current">
<xsl:value-of select="$i+1"/>
</span>
</xsl:if>
<!-- Рекурсивный вызов шаблона. НЕОБХОДИМО ПЕРЕДАВАТЬ ВСЕ НЕОБХОДИМЫЕ ПАРАМЕТРЫ! -->
<xsl:call-template name="for">
<xsl:with-param name="i" select="$i + 1"/>
<xsl:with-param name="prefix" select="$prefix"/>
<xsl:with-param name="items_on_page" select="$items_on_page"/>
<xsl:with-param name="current_page" select="$current_page"/>
<xsl:with-param name="count_items" select="$count_items"/>
<xsl:with-param name="visible_pages" select="$visible_pages"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Склонение после числительных -->
<xsl:template name="declension">
<xsl:param name="number" select="number"/>
<!-- Именительный падеж -->
<xsl:variable name="nominative">
<xsl:text>позиция</xsl:text>
</xsl:variable>
<!-- Родительный падеж, единственное число -->
<xsl:variable name="genitive_singular">
<xsl:text>позиции</xsl:text>
</xsl:variable>
<xsl:variable name="genitive_plural">
<xsl:text>позиций</xsl:text>
</xsl:variable>
<xsl:variable name="last_digit">
<xsl:value-of select="$number mod 10"/>
</xsl:variable>
<xsl:variable name="last_two_digits">
<xsl:value-of select="$number mod 100"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$last_digit = 1 and $last_two_digits != 11">
<xsl:value-of select="$nominative"/>
</xsl:when>
<xsl:when test="$last_digit = 2 and $last_two_digits != 12 or $last_digit = 3 and $last_two_digits != 13 or $last_digit = 4 and $last_two_digits != 14">
<xsl:value-of select="$genitive_singular"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$genitive_plural"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="Windows-1251" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
<xsl:decimal-format name="my" decimal-separator="," grouping-separator="."/>
<xsl:template match="/">
<xsl:apply-templates select="/document"/>
</xsl:template>
<xsl:template match="/document">
<!-- Ссылка на добавление в корзину -->
<SCRIPT>
<xsl:comment>
<xsl:text disable-output-escaping="yes">
<![CDATA[
function set_count_mod(input_id, step)
{
var oCountMod = document.getElementById(input_id);
if (!(iCurrCount = parseInt(oCountMod.value))) {
iCurrCount = 0;
}
if (!(iCurrCount <= 0 && step < 0)) {
oCountMod.value = iCurrCount + step;
}
}
]]>
</xsl:text>
</xsl:comment>
</SCRIPT>
<!-- Форма поиска -->
<form method="get" action="/search/">
<input type="text" size="50" name="text" value="{search_query}" maxlength="200" class="input_buttom_search"/>
 
<input type="submit" class="input_buttom_search_button" value="Искать"/>
</form>
<xsl:if test="search_query!=''">
<p>
<strong>Найдено <xsl:value-of select="count_items"/> <xsl:call-template name="declension">
<xsl:with-param name="number" select="count_items"/></xsl:call-template></strong>
</p>
<!--<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td width="30"></td>
<td width="300"><b>Наименование</b></td>
<td width="130"><b>Артикул</b></td>
<td width="150"><b>Производитель</b></td>
<td width="100"><b>Цена</b></td>
</tr>
</table>-->
<xsl:if test="count_items!=0">
<div start="{(current_page - 1) * items_on_page + 1}">
<xsl:apply-templates select="item">
</xsl:apply-templates>
</div>
<!-- Строка ссылок на другие страницы результата поиска -->
<p>
<xsl:call-template name="for">
<xsl:with-param name="items_on_page" select="items_on_page"/>
<xsl:with-param name="current_page" select="current_page - 1"/>
<xsl:with-param name="count_items" select="count_items"/>
<xsl:with-param name="visible_pages">5</xsl:with-param>
</xsl:call-template>
<div style="clear: both"></div>
</p>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="item">
<div>
<xsl:choose>
<!-- Если магазин (page_module = 3) и тип элемента товары (page_module_value_type = 2) -->
<xsl:when test="page_module = 3 and page_module_value_type = 2">
<xsl:apply-templates select="item" mode="shop" />
</xsl:when>
<xsl:otherwise>
<a href="{page_address}">
<xsl:value-of select="page_name"/>
</a>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
<!-- Шаблон для товара -->
<xsl:template match="item/item" mode="shop">
<!-- Определяем цвет фона -->
<xsl:variable name="background_color">
<xsl:choose>
<xsl:when test="(position() + 1) mod 2 > 0">#f7f7f7</xsl:when>
<xsl:otherwise>#ffffff</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div>
<table class="items">
<tbody>
<tr>
<td class="ls">
<div class="photo">
<xsl:if test="small_image != ''">
<a href="{/shop/path}{fullpath}" >
<img src="{small_image}" style="border: 1px solid #DADADA; margin: 0px 5px 5px 0px" alt="{name}" title="{name}"/>
</a>
</xsl:if>
</div>
<b><xsl:value-of disable-output-escaping="yes" select="name"/></b>
<hr />
<div class="descrs">
<xsl:value-of disable-output-escaping="yes" select="description"/>
<xsl:if test="count(group) > 1">
<xsl:apply-templates select="group" mode="sub_group"/>
</xsl:if>
</div>
</td>
<td class="rs">
<div class="prices">
<!-- Цена товара -->
<xsl:choose>
<xsl:when test="price != 0">
<xsl:variable name="pric" select="price"/>
<span>
<xsl:value-of select="format-number($pric, '###.##0,00', 'my')"/> 
<!-- Валюта товара -->
<xsl:value-of disable-output-escaping="yes" select="currency"/>
</span>
</xsl:when>
<xsl:otherwise>
<b>цена договорная</b>
</xsl:otherwise>
</xsl:choose>
<!-- Если цена со скидкой - выводим ее -->
<xsl:if test="price!=price_tax">
<br/>
<font color="gray">
<strike>
<xsl:variable name="pric_tax" select="price_tax"/>
<xsl:value-of select="format-number($pric_tax, '###.##0,00', 'my')"/> <xsl:value-of disable-output-escaping="yes" select="currency"/>
</strike>
</font>
</xsl:if>
</div>
<div class="artics">
<xsl:if test="marking_of_goods != ''">
<p>Артикул: <b><xsl:value-of disable-output-escaping="yes" select="marking_of_goods"/></b></p>
</xsl:if>
</div>
<div class="compares">
<input type="text" size="2" value="1" id="count_{@id}"/>
<img src="/images/map_intocart.gif" width="12" height="21" border="0" usemap="#mapInToCart{@id}" style="margin: 0 0 -5px 1px;"/>
<map name="mapInToCart{@id}">
<area shape="rect" coords="0,0,12,10" onclick="set_count_mod('count_{@id}', 1);" nohref="nohref" />
<area shape="rect" coords="0,11,12,21" onclick="set_count_mod('count_{@id}', -1);" nohref="nohref" />
</map>
</div>
<div class="bottons">
<a href="{/shop/path}cart/?action=add&item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}').value)">
<img alt="В корзину" title="В корзину" src="/hostcmsfiles/images/cartcl.gif" style="margin: 0px 0px -4px 10px" />
</a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</xsl:template>
<xsl:template name="page_address" match="text()">
<xsl:param name="str" select="."/>
<xsl:param name="max">50</xsl:param>
<xsl:param name="hvost">10</xsl:param>
<xsl:param name="begin">
<xsl:choose>
<xsl:when test="string-length($str) > $max">
<xsl:value-of select="substring($str, 1, $max - $hvost)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($str, 1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="end">
<xsl:choose>
<xsl:when test="string-length($str) > $max">
<xsl:value-of select="substring($str, string-length($str) - $hvost + 1, $hvost)"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="result">
<xsl:choose>
<xsl:when test="$end != ''">
<xsl:value-of select="concat($begin, '…', $end)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$begin"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:value-of disable-output-escaping="yes" select="$result"/>
</xsl:template>
<!-- Цикл для вывода строк ссылок -->
<xsl:template name="for">
<xsl:param name="i" select="0"/>
<xsl:param name="prefix">page</xsl:param>
<xsl:param name="items_on_page"/>
<xsl:param name="current_page"/>
<xsl:param name="count_items"/>
<xsl:param name="visible_pages"/>
<xsl:variable name="n" select="$count_items div $items_on_page"/>
<!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
<xsl:variable name="parent_group_id" select="/document/blocks/parent_group_id"/>
<!-- Считаем количество выводимых ссылок перед текущим элементом -->
<xsl:variable name="pre_count_page">
<xsl:choose>
<xsl:when test="$current_page > ($n - (round($visible_pages div 2) - 1))">
<xsl:value-of select="$visible_pages - ($n - $current_page)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Считаем количество выводимых ссылок после текущего элемента -->
<xsl:variable name="post_count_page">
<xsl:choose>
<xsl:when test="0 > $current_page - (round($visible_pages div 2) - 1)">
<xsl:value-of select="$visible_pages - $current_page - 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="round($visible_pages div 2) = ($visible_pages div 2)">
<xsl:value-of select="$visible_pages div 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$count_items > $items_on_page and $n > $i">
<!-- Определяем адрес ссылки -->
<xsl:variable name="number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="$i != 0">&<xsl:value-of select="$prefix"/>=<xsl:value-of select="$i + 1"/></xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Ставим ссылку на страницу-->
<xsl:if test="$i != $current_page">
<!-- Выводим ссылку на первую страницу -->
<xsl:if test="$current_page - $pre_count_page > 0 and $i = 0">
<a href="./?text={search_query_url}" class="page_link" style="text-decoration: none;">←</a>
</xsl:if>
<xsl:choose>
<xsl:when test="$i >= ($current_page - $pre_count_page) and ($current_page + $post_count_page) >= $i">
<!-- Выводим ссылки на видимые страницы -->
<a href="./?text={search_query_url}{$number_link}" class="page_link">
<xsl:value-of select="$i + 1"/>
</a>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
<!-- Выводим ссылку на последнюю страницу -->
<xsl:if test="$i+1 >= $n and $n > ($current_page + 1 + $post_count_page)">
<xsl:choose>
<xsl:when test="$n > round($n)">
<!-- Выводим ссылку на последнюю страницу -->
<a href="./?text={search_query_url}&{$prefix}={round($n+1)}" class="page_link" style="text-decoration: none;">→</a>
</xsl:when>
<xsl:otherwise>
<a href="./?text={search_query_url}&{$prefix}={round($n)}" class="page_link" style="text-decoration: none;">→</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:if>
<!-- Ссылка на предыдущую страницу для Ctrl + влево -->
<xsl:if test="$current_page != 0 and $i = $current_page">
<xsl:variable name="prev_number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="($current_page - 1) != 0">&<xsl:value-of select="$prefix"/>=<xsl:value-of select="$i"/></xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="./?text={search_query_url}{$prev_number_link}" id="id_prev"></a>
</xsl:if>
<!-- Ссылка на следующую страницу для Ctrl + вправо -->
<xsl:if test="($n - 1) > $current_page and $i = $current_page">
<a href="./?text={search_query_url}&{$prefix}={$current_page+2}" id="id_next"></a>
</xsl:if>
<!-- Не ставим ссылку на страницу-->
<xsl:if test="$i = $current_page">
<span class="current">
<xsl:value-of select="$i+1"/>
</span>
</xsl:if>
<!-- Рекурсивный вызов шаблона. НЕОБХОДИМО ПЕРЕДАВАТЬ ВСЕ НЕОБХОДИМЫЕ ПАРАМЕТРЫ! -->
<xsl:call-template name="for">
<xsl:with-param name="i" select="$i + 1"/>
<xsl:with-param name="prefix" select="$prefix"/>
<xsl:with-param name="items_on_page" select="$items_on_page"/>
<xsl:with-param name="current_page" select="$current_page"/>
<xsl:with-param name="count_items" select="$count_items"/>
<xsl:with-param name="visible_pages" select="$visible_pages"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Склонение после числительных -->
<xsl:template name="declension">
<xsl:param name="number" select="number"/>
<!-- Именительный падеж -->
<xsl:variable name="nominative">
<xsl:text>позиция</xsl:text>
</xsl:variable>
<!-- Родительный падеж, единственное число -->
<xsl:variable name="genitive_singular">
<xsl:text>позиции</xsl:text>
</xsl:variable>
<xsl:variable name="genitive_plural">
<xsl:text>позиций</xsl:text>
</xsl:variable>
<xsl:variable name="last_digit">
<xsl:value-of select="$number mod 10"/>
</xsl:variable>
<xsl:variable name="last_two_digits">
<xsl:value-of select="$number mod 100"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$last_digit = 1 and $last_two_digits != 11">
<xsl:value-of select="$nominative"/>
</xsl:when>
<xsl:when test="$last_digit = 2 and $last_two_digits != 12 or $last_digit = 3 and $last_two_digits != 13 or $last_digit = 4 and $last_two_digits != 14">
<xsl:value-of select="$genitive_singular"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$genitive_plural"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Даже поломанные часы два раза в сутки показывают правильное время
Это вам надо ссылочки поправить в шаблоне
в ссылках
вместо
Потому что в xml поиска нет узла /shop/path, который бы хранил путь к магазину.
в ссылках
<a href="{/shop/path}{fullpath}" >
и <a href="{/shop/path}cart/?action=add&item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}').value)">
вместо
{/shop/path}
жестко указать путь /shop/
Потому что в xml поиска нет узла /shop/path, который бы хранил путь к магазину.
Заказов не беру. Консультирую редко.
Авторизация